This specification defines a data type for a MIDI message, MidiEvent, which is normalised for fast and convenient real-time processing. MIDI is the Musical Instrument Digital Interface, a ubiquitous binary standard for controlling digital music devices.

For plugins that process MIDI (or other situations where MIDI is sent via a generic transport) the main type defined here, MidiEvent, can be mapped to an integer and used as the type of an LV2 Atom or Event.

This specification also defines a complete vocabulary for the MIDI standard, except for standard controller numbers. These descriptions are detailed enough to express any MIDI message as properties.

Index

ClassesProperties

Classes

ActiveSense

Class
LabelActive Sense
Subclass ofSystemRealtime
status FE

MIDI active sense message.

Aftertouch

Class
LabelAftertouch
Subclass ofVoiceMessage
chunk
byteNumber 0
property noteNumber
chunk
byteNumber 1
property pressure
statusMask A0

MIDI aftertouch message.

Bender

Class
LabelBender
Subclass ofVoiceMessage
chunk
byteNumber 0
byteNumber 1
property benderValue
statusMask E0

MIDI bender message.

ChannelPressure

Class
LabelChannel Pressure
Subclass ofVoiceMessage
chunk
byteNumber 0
property pressure
statusMask D0

MIDI channel pressure message.

Chunk

Class
LabelChunk
In domain ofbyteNumber
property
In range ofchunk

A sequence of contiguous bytes in a MIDI message.

Clock

Class
LabelClock
Subclass ofSystemRealtime
status F8

MIDI clock message.

Continue

Class
LabelContinue
Subclass ofSystemRealtime
status FB

MIDI continue message.

Controller

Class
LabelController
Subclass ofVoiceMessage
chunk
byteNumber 0
property controllerNumber
chunk
byteNumber 1
property controllerValue
statusMask B0

MIDI controller change message.

HexByte

Class
LabelHex Byte
In range ofstatus
statusMask
velocity
owl:onDatatype xsd:hexBinary

A hexadecimal byte, which has a value <= FF.

MidiEvent

Class
LabelMIDI Message
Subclass ofatom:Atom
ev:Event
Superclass ofSystemMessage
VoiceMessage
In range ofbinding
owl:onDatatype xsd:hexBinary

A single raw MIDI message.

A single raw MIDI message (a sequence of bytes).

This is equivalent to a standard MIDI messages, except with the following restrictions to simplify handling:

  • Running status is not allowed, every message must have its own status byte.

  • Note On messages with velocity 0 are not allowed. These messages are equivalent to Note Off in standard MIDI streams, but here only proper Note Off messages are allowed.

  • "Realtime messages" (status bytes 0xF8 to 0xFF) are allowed, but may not occur inside other messages like they can in standard MIDI streams.

  • All messages are complete valid MIDI messages. This means, for example, that only the first byte in each event (the status byte) may have the eighth bit set, that Note On and Note Off events are always 3 bytes long, etc.

Where messages are communicated, the writer is responsible for writing valid messages, and the reader may assume that all events are valid.

If a MidiEvent is serialised to a string, the format should be xsd:hexBinary, for example:

[] eg:someEvent "901A01"^^MidiEvent .

NoteOff

Class
LabelNote Off
Subclass ofVoiceMessage
chunk
byteNumber 0
property noteNumber
chunk
byteNumber 1
property velocity
statusMask 80

MIDI note off message.

NoteOn

Class
LabelNote On
Subclass ofVoiceMessage
chunk
byteNumber 0
property noteNumber
chunk
byteNumber 1
property velocity
statusMask 90

MIDI note on message.

ProgramChange

Class
LabelProgram Change
Subclass ofVoiceMessage
chunk
byteNumber 0
property programNumber
statusMask C0

MIDI program change message.

QuarterFrame

Class
LabelQuarter Frame
Subclass ofSystemCommon
status F1

MIDI quarter frame message.

Reset

Class
LabelReset
Subclass ofSystemRealtime
status FF

MIDI reset message.

SongPosition

Class
LabelSong Position
Subclass ofSystemCommon
chunk
byteNumber 0
byteNumber 1
property songPosition
status F2

MIDI song position pointer message.

SongSelect

Class
LabelSong Select
Subclass ofSystemCommon
status F3

MIDI song select message.

Start

Class
LabelStart
Subclass ofSystemRealtime
status FA

MIDI start message.

Stop

Class
LabelStop
Subclass ofSystemRealtime
status FC

MIDI stop message.

SystemCommon

Class
LabelSystem Common
Subclass ofSystemMessage
Superclass ofQuarterFrame
SongPosition
SongSelect
TuneRequest

MIDI system common message.

SystemExclusive

Class
LabelSystem Exclusive
Subclass ofSystemMessage
status F0

MIDI system exclusive message.

SystemMessage

Class
LabelSystem Message
Subclass ofMidiEvent
Superclass ofSystemCommon
SystemExclusive
SystemRealtime
statusMask F0

MIDI system message.

SystemRealtime

Class
LabelSystem Realtime
Subclass ofSystemMessage
Superclass ofActiveSense
Clock
Continue
Reset
Start
Stop

MIDI system realtime message.

TuneRequest

Class
LabelTune Request
Subclass ofSystemCommon
status F6

MIDI tune request message.

VoiceMessage

Class
LabelVoice Message
Subclass ofMidiEvent
Superclass ofAftertouch
Bender
ChannelPressure
Controller
NoteOff
NoteOn
ProgramChange
statusMask F0

MIDI voice message.

Properties

benderValue

Property
Labelbender value
Rangexsd:short
TypeDatatype Property

MIDI pitch bender message (-8192 to 8192).

binding

Property
Labelbinding
RangeMidiEvent
TypeObject Property

The MIDI event to bind a parameter to.

byteNumber

Property
Labelbyte number
DomainChunk
Rangexsd:unsignedByte
TypeDatatype Property

The 0-based index of a byte which is part of this chunk.

channel

Property
LabelMIDI channel
Rangexsd:unsignedByte
TypeDatatype Property

The channel number of a MIDI message.

chunk

Property
LabelMIDI chunk
RangeChunk
TypeObject Property

A chunk of a MIDI message.

controllerNumber

Property
LabelMIDI controller number
Rangexsd:byte
TypeDatatype Property

The numeric ID of a controller (0 to 127).

controllerValue

Property
LabelMIDI controller value
Rangexsd:byte
TypeDatatype Property

The value of a controller (0 to 127).

noteNumber

Property
Labelnote number
Rangexsd:byte
TypeDatatype Property

The numeric ID of a note (0 to 127).

pressure

Property
Labelkey pressure
Rangexsd:byte
TypeDatatype Property

Key pressure (0 to 127).

programNumber

Property
Labelprogram number
Rangexsd:byte
TypeDatatype Property

The numeric ID of a program (0 to 127).

property

Property
Labelproperty
DomainChunk
Rangerdf:Property
TypeObject Property

The property this chunk represents.

songNumber

Property
Labelsong number
Rangexsd:byte
TypeDatatype Property

The numeric ID of a song (0 to 127).

songPosition

Property
Labelsong position
Rangexsd:short
TypeDatatype Property

Song position in MIDI beats (16th notes) (-8192 to 8192).

status

Property
Labelstatus byte
RangeHexByte
TypeDatatype Property

The exact status byte for a message of this type.

statusMask

Property
Labelstatus mask
RangeHexByte
TypeDatatype Property

The status byte for a message of this type on channel 1.

This is a status byte with the lower nibble set to zero.

velocity

Property
Labelvelocity
RangeHexByte
TypeDatatype Property

The velocity of a note message (0 to 127).

History

Version 1.10 (2019-02-03)
  • Fix incorrect range of midi:chunk.
Version 1.8 (2012-10-14)
  • Use consistent label style.
  • Add midi:binding and midi:channel predicates.
  • Add midi:HexByte datatype for status bytes and masks.
  • Remove non-standard midi:Tick message type.
  • Add C definitions for message types and standard controllers.
  • Fix definition of SystemExclusive status byte.
Version 1.6 (2012-04-17)
  • Add class definitions for various message types.
  • Document how to serialise a MidiEvent to a string.
  • Merge with unified LV2 package.
Version 1.4 (2011-11-21)
  • Update packaging.
  • Improve documentation.
Version 1.2 (2011-05-26)
  • Add build system for installation.
  • Switch to ISC license.
Version 1.0 (2010-10-04)
  • Initial release.