Karya, built on Sun Nov 26 01:04:37 PST 2017 (patch 0a920b2bde70c0cbac8ee09d158064798b61bbe5)

Safe HaskellNone

Midi.Interface

Contents

Description

Common interface for the MIDI drivers.

Synopsis

Documentation

data RawInterface write_message Source #

Produced by an initialize function.

Constructors

Interface 

Fields

Instances

data Message Source #

Annotate a WriteMessage with additional control messages.

Constructors

Midi !Midi.WriteMessage 
AllNotesOff !RealTime

Turn off sounding notes on all devices and channels.

AllDevices !RealTime ![Midi.Message]

Emit the messages for all devices that have been used. This doesn't care if they have sounding notes because control state persists after NoteOff.

implementation

note_tracker :: (Midi.WriteMessage -> IO Bool) -> IO (Message -> IO Bool) Source #

Wrap a write_message and keep track of which notes are on. It can then handle reset messages which need to know current state to reset it.

This is necessary because some synthesizers do not support AllNotesOff, but also relieves callers of having to track which devices and channels have active notes.

send_devices :: RealTime -> [Midi.Message] -> TrackerM [Midi.WriteMessage] Source #

Send the given messages on all devices.