Bang-0.1.0.4: A Drum Machine DSL for Haskell

Safe HaskellNone
LanguageHaskell2010

System.MIDI.MacOSX

Description

A lowest common denominator interface to the Win32 and MacOSX MIDI bindings, MacOSX part.

Synopsis

Documentation

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

Minimal complete definition

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.