Karya, built on Mon Jul 24 11:39:07 PDT 2017 (patch 33511aca01257b76b88de7c7a2763b7a965c084e)

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.