Bang-0.1.0.4: A Drum Machine DSL for Haskell

Safe HaskellNone
LanguageHaskell2010

System.MacOSX.CoreMIDI

Description

Low-level binding to the CoreMIDI services present in Mac OS X. Error handling is via fail-s in the IO monad.

Synopsis

Documentation

enumerateDevices :: IO [MIDIDeviceRef] Source

Note: If a client iterates through the devices and entities in the system, it will not ever visit any virtual sources and destinations created by other clients. Also, a device iteration will return devices which are offline (were present in the past but are not currently present), while iterations through the system's sources and destinations will not include the endpoints of offline devices.

Thus clients should usually use enumerateSources and enumerateDestinations, rather iterating through devices and entities to locate endpoints.

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

newSource :: MIDIClientRef -> String -> IO Source Source

Creates a new MIDI source with the given name.

newDestination :: MIDIClientRef -> String -> IO Destination Source

Creates a new MIDI destination with the given name.

disposeEndpoint :: Endpoint a => a -> IO () Source

Disposes an existing MIDI endpoint.

newClient :: String -> IO MIDIClientRef Source

Creates a new MIDI client with the given name.

disposeClient :: MIDIClientRef -> IO () Source

Disposes an existing MIDI client.

newInputPort :: MIDIClientRef -> String -> FunPtr (MIDIReadProc r s) -> Ptr r -> IO MIDIPortRef Source

Creates a new input port.

newOutputPort :: MIDIClientRef -> String -> IO MIDIPortRef Source

Creates a new output port.

disposePort :: MIDIPortRef -> IO () Source

Disposes an existing port.

connectToSource :: MIDIPortRef -> Source -> Ptr a -> IO () Source

Connects an input port to a source.

disconnectFromSource :: MIDIPortRef -> Source -> IO () Source

Disconnects an input port from a source.

midiSend :: MIDIPortRef -> Destination -> ShortMessage -> IO () Source

Sends a short message with timestamp "now".

midiSend' :: MIDIPortRef -> Destination -> MIDITimeStamp -> ShortMessage -> IO () Source

Sends a short message with the given timestamp.

midiSendList :: MIDIPortRef -> Destination -> [ShortMessage] -> IO () Source

Sends a list of short messages with timestamp "now".

midiSendList' :: MIDIPortRef -> Destination -> MIDITimeStamp -> [ShortMessage] -> IO () Source

Sends a list of short messages with the given timestamp.

midiSendSysEx :: Endpoint a => a -> [Word8] -> IO () Source

type MIDIReadProc r s = Ptr MIDIPacket -> Ptr r -> Ptr s -> IO () Source

r is readProcRefCon (The refCon you passed to MIDIInputPortCreate or MIDIDestinationCreate); s is srcConnRefCon (A refCon you passed to MIDIPortConnectSource, which identifies the source of the data).