midi-alsa-0.2: Convert between datatypes of the midi and the alsa packages

Safe HaskellSafe-Infered

Sound.MIDI.ALSA

Contents

Synopsis

value conversions

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.

construction of event data records

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.