Safe Haskell | Safe-Infered |
---|
- toChannel :: Channel -> Channel
- fromChannel :: Channel -> Channel
- toPitch :: Pitch -> Pitch
- fromPitch :: Pitch -> Pitch
- toVelocity :: Velocity -> Velocity
- fromVelocity :: Velocity -> Velocity
- normalizeNote :: (NoteEv, Velocity) -> (NoteEv, Velocity)
- normalNoteFromEvent :: NoteEv -> Note -> (NoteEv, Velocity)
- toController :: Parameter -> Controller
- fromController :: Controller -> Parameter
- toProgram :: Value -> Program
- fromProgram :: Program -> Value
- noteEvent :: Channel -> Pitch -> Velocity -> Velocity -> Int -> Note
- controllerEvent :: Channel -> Controller -> Int -> Ctrl
- programChangeEvent :: Channel -> Program -> Ctrl
- modeEvent :: Channel -> T -> Ctrl
- noteChannel :: T Note Channel
- notePitch :: T Note Pitch
- noteVelocity :: T Note Velocity
- ctrlChannel :: T Ctrl Channel
- ctrlController :: T Ctrl Controller
- data ControllerMode
- = Controller Controller Int
- | Mode T
- ctrlControllerMode :: T Ctrl ControllerMode
- ctrlValue :: T Ctrl Int
- ctrlProgram :: T Ctrl Program
value conversions
fromChannel :: Channel -> ChannelSource
toVelocity :: Velocity -> VelocitySource
normalizeNote :: (NoteEv, Velocity) -> (NoteEv, Velocity)Source
Return a NoteOff
if input is a NoteOn
with velocity zero.
This is a trick of the MIDI standard
in order to allow compression of a series of note events.
After normalization you can safely match on NoteOn
and NoteOff
.
toController :: Parameter -> ControllerSource
Controllers from 0x78
to 0x7F
are special,
you must assert that the controller number is in the range 0
to 0x77
.
fromProgram :: Program -> ValueSource
construction of event data records
controllerEvent :: Channel -> Controller -> Int -> CtrlSource
programChangeEvent :: Channel -> Program -> CtrlSource
accessors to event data fields
noteVelocity :: T Note VelocitySource
This may not yield what you expect.
See normalizeNote
.
ctrlController :: T Ctrl ControllerSource
This is undefined, if the controller is no regular controller
but a channel mode message.
Better use ctrlControllerMode
.