Safe Haskell | Safe-Inferred |
---|---|
Language | Haskell2010 |
Channel messages
Synopsis
- data T = Cons {}
- data Body
- get :: C parser => Int -> Channel -> Int -> Fragile parser T
- getWithStatus :: C parser => Int -> Fragile (T parser) T
- put :: C writer => T -> writer
- putWithStatus :: (Compression compress, C writer) => T -> T compress writer
- data Channel
- fromChannel :: Channel -> Int
- toChannel :: Int -> Channel
- data Pitch
- fromPitch :: Pitch -> Int
- toPitch :: Int -> Pitch
- data Velocity
- fromVelocity :: Velocity -> Int
- toVelocity :: Int -> Velocity
- data Program
- fromProgram :: Program -> Int
- toProgram :: Int -> Program
- data Controller
- fromController :: Controller -> Int
- toController :: Int -> Controller
- decodeStatus :: Int -> (Int, Channel)
Documentation
Cons | |
|
Instances
Arbitrary T Source # | |
Show T Source # | |
Eq T Source # | |
Ord T Source # | |
C T Source # | |
Defined in Sound.MIDI.Message.Class.Check | |
C T Source # | |
Defined in Sound.MIDI.Message.Class.Construct | |
C T Source # | |
Defined in Sound.MIDI.Message.Class.Query |
get :: C parser => Int -> Channel -> Int -> Fragile parser T Source #
Parse a MIDI Channel message. Note that since getting the first byte is a little complex (there are issues with running status), the code, channel and first data byte must be determined by the caller.
getWithStatus :: C parser => Int -> Fragile (T parser) T Source #
Parse an event.
Note that in the case of a regular MIDI Event, the tag is the status,
and we read the first byte of data before we call get
.
In the case of a MIDIEvent with running status,
we find out the status from the parser
(it's been nice enough to keep track of it for us),
and the tag that we've already gotten is the first byte of data.
putWithStatus :: (Compression compress, C writer) => T -> T compress writer Source #
This definition should be in Message.Channel, but this results in a cyclic import.
Instances
Arbitrary Channel Source # | |
Bounded Channel Source # | |
Enum Channel Source # | |
Ix Channel Source # | |
Defined in Sound.MIDI.Parser.Status | |
Show Channel Source # | |
Eq Channel Source # | |
Ord Channel Source # | |
fromChannel :: Channel -> Int Source #
Instances
Arbitrary Velocity Source # | |
Bounded Velocity Source # | ToDo: We have defined minBound = Velocity 0, but strictly spoken the minimum Velocity is 1, since Velocity zero means NoteOff. One can at least think of NoteOff with (Velocity 0), but I have never seen that. |
Show Velocity Source # | |
Eq Velocity Source # | |
Ord Velocity Source # | |
Defined in Sound.MIDI.Message.Channel.Voice | |
Random Velocity Source # | |
fromVelocity :: Velocity -> Int Source #
toVelocity :: Int -> Velocity Source #
Instances
Arbitrary Program Source # | |
Bounded Program Source # | |
Enum Program Source # | |
Ix Program Source # | |
Defined in Sound.MIDI.Message.Channel.Voice | |
Show Program Source # | |
Eq Program Source # | |
Ord Program Source # | |
Defined in Sound.MIDI.Message.Channel.Voice | |
Random Program Source # | |
fromProgram :: Program -> Int Source #
data Controller Source #
We do not define Controller
as enumeration with many constructors,
because some controllers have multiple names and some are undefined.
It is also more efficient this way.
Thus you cannot use case
for processing controller types,
but you can use lookup
instead.
maybe (putStrLn "unsupported controller") putStrLn $ lookup ctrl $ (portamento, "portamento") : (modulation, "modulation") : []
Instances
fromController :: Controller -> Int Source #
toController :: Int -> Controller Source #