alsa-midi- Bindings for the ALSA sequencer API (MIDI stuff)




withEvents :: String -> String -> ([Event] -> IO a) -> IO aSource

Process MIDI events from ALSA in a lazy manner. The processing function must be strict, in order to let the cleanup take place after abandoning the process.

drainOutput :: Client -> IO ()Source

Strangly ALSA returns error code 2 (No such file or directory) if the destination port does not exist.

newtype Port Source


Port CUInt 

eventToChannelMsg :: Event -> Maybe TSource

This function checks whether the ALSA sequencer message is a MIDI channel message and converts to the corresponding data structure.

Note that ALSA sequencer events contain MIDI realtime messages, MIDI file events and additional events. We do not want to define yet another data structure additionally to Event and the message types from the midi package. Instead, because we believe, that most of the time you cope with certain types of events in bundles, we provide functions that allow easy access to these types. Currently we provide only access to MIDI channel messages but that can be easily extended. Multiple handlers of certain event types can be composed using Control.Monad.mplus.

NoteOn events with zero velocity are not automatically converted to NoteOff events, this can be done with the Sound.MIDI.Message.Channel.Voice.explicitNoteOff function.