Safe Haskell | None |
---|---|
Language | Haskell2010 |
A lowest common denominator interface to the Win32 and MacOSX MIDI bindings, MacOSX part.
- module System.MIDI.Base
- data Source
- data Destination
- data Connection
- enumerateSources :: IO [Source]
- enumerateDestinations :: IO [Destination]
- class MIDIObject a => MIDIHasName a where
- openSource :: Source -> Maybe ClientCallback -> IO Connection
- openDestination :: Destination -> IO Connection
- close :: Connection -> IO ()
- send :: Connection -> MidiMessage -> IO ()
- sendSysEx :: Connection -> [Word8] -> IO ()
- start :: Connection -> IO ()
- stop :: Connection -> IO ()
- getNextEvent :: Connection -> IO (Maybe MidiEvent)
- getEvents :: Connection -> IO [MidiEvent]
- currentTime :: Connection -> IO Word32
Documentation
module System.MIDI.Base
data Connection Source
The opaque data type representing a MIDI connection
enumerateSources :: IO [Source] Source
Enumaretes the MIDI sources present.
enumerateDestinations :: IO [Destination] Source
Enumaretes the MIDI destinations present.
class MIDIObject a => MIDIHasName a where Source
MIDI objects which can have a name, model name and manufacturer
Nothing
openSource :: Source -> Maybe ClientCallback -> IO Connection Source
Opens a MIDI Source. There are two possibilites to receive MIDI messages. The user can either support a callback function, or get the messages from an asynchronous buffer. However, mixing the two approaches is not allowed.
openDestination :: Destination -> IO Connection Source
Opens a MIDI Destination.
close :: Connection -> IO () Source
Closes a MIDI Connection
send :: Connection -> MidiMessage -> IO () Source
Sends a short message. The connection must be a Destination
.
sendSysEx :: Connection -> [Word8] -> IO () Source
Sends a system exclusive message. You shouldn't include the starting / trailing bytes 0xF0 and 0xF7.
start :: Connection -> IO () Source
Starts a connection. This is required for receiving MIDI messages, and also for starting the clock.
stop :: Connection -> IO () Source
Stops a connection.
getNextEvent :: Connection -> IO (Maybe MidiEvent) Source
Gets the next event from a buffered connection.
getEvents :: Connection -> IO [MidiEvent] Source
Gets all the events from the buffer.
currentTime :: Connection -> IO Word32 Source
Returns the time elapsed since the last start
call, in milisecs.