Safe Haskell | None |
---|---|
Language | Haskell98 |
Sound.MIDI.ALSA
Synopsis
- 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 -> Channel Source #
toVelocity :: Velocity -> Velocity Source #
fromVelocity :: Velocity -> Velocity Source #
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 -> Controller Source #
Controllers from 0x78
to 0x7F
are special,
you must assert that the controller number is in the range 0
to 0x77
.
fromController :: Controller -> Parameter Source #
fromProgram :: Program -> Value Source #
construction of event data records
controllerEvent :: Channel -> Controller -> Int -> Ctrl Source #
accessors to event data fields
noteVelocity :: T Note Velocity Source #
This may not yield what you expect.
See normalizeNote
.
ctrlController :: T Ctrl Controller Source #
This is undefined, if the controller is no regular controller
but a channel mode message.
Better use ctrlControllerMode
.
data ControllerMode Source #
Constructors
Controller Controller Int | |
Mode T |
Instances
Show ControllerMode Source # | |
Defined in Sound.MIDI.ALSA Methods showsPrec :: Int -> ControllerMode -> ShowS # show :: ControllerMode -> String # showList :: [ControllerMode] -> ShowS # | |
Eq ControllerMode Source # | |
Defined in Sound.MIDI.ALSA Methods (==) :: ControllerMode -> ControllerMode -> Bool # (/=) :: ControllerMode -> ControllerMode -> Bool # |