OM# Documentation

MIDI Events

It is possible to ignore most of the underlying MIDI infrastructure and concepts when using score objects in OM#; however, some tools and data structures presented here allow working with it to process or render other musical structures.

The class MIDIEVENT

The class MIDIEVENT represents a simple MIDI message. It can be parameterized and sent out to a MIDI port, or processed and grouped along with other events to consitute musical sequences, typically in a DATA-TRACK, a MIDI-TRACK container, or in a Sequencer.

MIDIEVENT slots correspond to the basic attributes of a MIDI message:

Although not part of the MIDI message format, MIDIEVENT also includes two other parameters which help its manipulation and processing in the software:

In MIDI, notes are expressed by the succession of two events of types KeyOn and KeyOff, which correspond to the activation and release of a given “key”. → MIDI-NOTE is a specialized class suitable to represent a note at higher, “musical” level, and adapted to MIDI-TRACK containers.

Extracting and processing MIDIEVENTs

get-midievents is a generic functions allowing to extract a list of MIDIEVENT from a MIDI-TRACK, or any compatible musical object:

Note: We use evt-to-string to control the list of MIDIEVENT as text in a TEXTBUFFER.

The optional input :test allows connecting a test (a filter function or a patch in lambda mode) in order to filter the list returned by get-midievents. The filter function must have one single free input, correponding to an input MIDIEVENT.

Available filters include test-midi-channel, test-midi-type, test-midi-track, test-date, etc. (see MIDI package).

MIDIEVENTs can be recomposed into a new list and provided as input to MIDI-TRACK and/or saved to a file to compose a new consolidated sequence.

The Help patches in the MIDI section provide advanced examples of MIDI event extraction and filtering.

Extracting additional MIDI info

A few other utilities in the MIDI package allow extracting or converting sepcific kinds of MIDI info: