Karya, built on 2018-05-31T02:46:59 (patch 0a1a35479c514820d77330ae8a978975ba22a47a)

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
Show (RawInterface a) # 
Instance details

Defined in Midi.Interface

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.

Instances
Show Message # 
Instance details

Defined in Midi.Interface

DeepSeq.NFData Message # 
Instance details

Defined in Midi.Interface

Methods

rnf :: Message -> () #

Pretty Message # 
Instance details

Defined in Midi.Interface

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.