# LV2 MIDI Extension # Copyright 2008-2012 David Robillard # Copyright 2006 Lars Luthman # # Permission to use, copy, modify, and/or distribute this software for any # purpose with or without fee is hereby granted, provided that the above # copyright notice and this permission notice appear in all copies. # # THIS SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES # WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF # MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR # ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. @prefix atom: . @prefix dcs: . @prefix doap: . @prefix ev: . @prefix foaf: . @prefix lv2: . @prefix midi: . @prefix rdf: . @prefix rdfs: . @prefix xsd: . a lv2:Specification ; rdfs:seeAlso , <../../people/people.ttl> ; doap:license ; doap:name "LV2 MIDI" ; doap:shortdesc "A normalised definition of raw MIDI." ; doap:maintainer ; doap:developer , ; doap:release [ doap:revision "1.5" ; doap:created "2012-02-19" ; dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Add class definitions for various message types." ; ] ; ] ; ] , [ doap:revision "1.4" ; doap:created "2011-11-21" ; doap:file-release ; dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Update packaging." ; ] , [ rdfs:label "Improve documentation." ; ] ; ] ; ] , [ doap:revision "1.2" ; doap:created "2011-05-26" ; doap:file-release ; dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Add build system for installation." ; ] , [ rdfs:label "Switch to ISC license." ; ] ; ] ; ] , [ doap:revision "1.0" ; doap:created "2010-10-04" ; doap:file-release ; dcs:blame ; dcs:changeset [ dcs:item [ rdfs:label "Initial release." ; ] ; ] ; ] ; lv2:documentation """

This extension defines a data type for a MIDI message, midi: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, midi:MidiEvent, can be mapped to an integer and used as the type of an LV2 Atom or Event.

This specification also defines a complete machine readable description of the MIDI standard (except for standard controller numbers). These descriptions are detailed enough to express any MIDI message in RDF. Message types are described down to the byte level, so all the information required to convert between binary MIDI and RDF MIDI is present. This specification thus serves as both a human and machine readable description of the MIDI specification.

""" . midi:ActiveSense a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Active sense message. " ; midi:status "FE"^^xsd:hexBinary . midi:Aftertouch a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Aftertouch (note pressure) message." ; midi:statusMask "A0"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:noteNumber ; ] , [ midi:byteNumber 1 ; midi:property midi:pressure ; ] . midi:Bender a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Bender (pitch wheel) message." ; midi:statusMask "E0"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 , 1 ; midi:property midi:benderValue ; ] . midi:ChannelPressure a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Channel pressure message." ; midi:statusMask "D0"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:pressure ; ] . midi:Chunk a rdfs:Class ; rdfs:comment "A series of contiguous bytes (usually one) in a message." . midi:Clock a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Clock message. " ; midi:status "F8"^^xsd:hexBinary . midi:Continue a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Continue message. " ; midi:status "FB"^^xsd:hexBinary . midi:Controller a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Controller change message." ; midi:statusMask "B0"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:controllerNumber ; ] , [ midi:byteNumber 1 ; midi:property midi:controllerValue ; ] . midi:MidiEvent a rdfs:Class ; rdfs:label "MIDI message." ; rdfs:subClassOf ev:Event , atom:Atom ; lv2:documentation """

A single raw MIDI message (i.e. 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.
""" . midi:NoteOff a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Note off message." ; midi:statusMask "80"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:noteNumber ; ] , [ midi:byteNumber 1 ; midi:property midi:velocity ; ] . midi:NoteOn a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Note on message." ; midi:statusMask "90"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:noteNumber ; ] , [ midi:byteNumber 1 ; midi:property midi:velocity ; ] . midi:ProgramChange a rdfs:Class ; rdfs:subClassOf midi:VoiceMessage ; rdfs:label "Program change message." ; midi:statusMask "C0"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 ; midi:property midi:programNumber ; ] . midi:QuarterFrame a rdfs:Class ; rdfs:subClassOf midi:SystemCommon ; rdfs:label "MTC quarter frame message." ; midi:status "F1"^^xsd:hexBinary . midi:Reset a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Reset message. " ; midi:status "FF"^^xsd:hexBinary . midi:SongPosition a rdfs:Class ; rdfs:subClassOf midi:SystemCommon ; rdfs:label "Song position pointer message." ; midi:status "F2"^^xsd:hexBinary ; midi:chunk [ midi:byteNumber 0 , 1 ; midi:property midi:songPosition ; ] . midi:SongSelect a rdfs:Class ; rdfs:subClassOf midi:SystemCommon ; rdfs:label "Song select message." ; midi:status "F3"^^xsd:hexBinary . midi:Start a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Start message. " ; midi:status "FA"^^xsd:hexBinary . midi:Stop a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Stop message. " ; midi:status "FC"^^xsd:hexBinary . midi:SystemCommon a rdfs:Class ; rdfs:subClassOf midi:SystemMessage ; rdfs:label "System common message." . midi:SystemExclusive a rdfs:Class ; rdfs:subClassOf midi:SystemMessage ; rdfs:label "System exclusive message." ; midi:statusMask "F0"^^xsd:hexBinary . midi:SystemMessage a rdfs:Class ; rdfs:subClassOf midi:MidiEvent ; rdfs:label "System message." ; midi:statusMask "F0"^^xsd:hexBinary . midi:SystemRealtime a rdfs:Class ; rdfs:subClassOf midi:SystemMessage ; rdfs:label "System realtime message." . midi:Tick a rdfs:Class ; rdfs:subClassOf midi:SystemRealtime ; rdfs:label "Tick message. " ; midi:status "F9"^^xsd:hexBinary . midi:TuneRequest a rdfs:Class ; rdfs:subClassOf midi:SystemCommon ; rdfs:label "Tune request message." ; midi:status "F6"^^xsd:hexBinary . midi:VoiceMessage a rdfs:Class ; rdfs:subClassOf midi:MidiEvent ; rdfs:label "Voice message." ; midi:statusMask "F0"^^xsd:hexBinary . midi:benderValue a rdf:Property ; rdfs:range xsd:short ; rdfs:comment "The value of a pitch bender (-8192 to 8192)." . midi:byteNumber a rdf:Property ; rdfs:domain midi:Chunk ; rdfs:range xsd:unsignedByte ; rdfs:comment "The 0-based index of a byte which is part of this chunk." . midi:chunk a rdf:Property ; rdfs:range xsd:byte , xsd:hexBinary ; rdfs:comment "The exact status byte for a message of this type." . midi:controllerNumber a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The numberic ID of a controller (0 to 127)." . midi:controllerValue a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The value of a controller (0 to 127)." . midi:noteNumber a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The numeric ID of a controller (0 to 127)." . midi:pressure a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "Key pressure (0 to 127)." . midi:programNumber a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The numeric ID of a program (0 to 127)." . midi:property a rdf:Property ; rdfs:domain midi:Chunk ; rdfs:range rdf:Property ; rdfs:comment "The property this chunk represents." . midi:songNumber a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The numeric ID of a song (0 to 127)." . midi:songPosition a rdf:Property ; rdfs:range xsd:short ; rdfs:comment "Song position in MIDI beats (16th notes) (-8192 to 8192)." . midi:status a rdf:Property ; rdfs:range xsd:byte , xsd:hexBinary ; rdfs:comment "The exact status byte for a message of this type." . midi:statusMask a rdf:Property ; rdfs:range xsd:byte , xsd:hexBinary ; rdfs:comment """ The status byte for a message of this type on channel 1, i.e. a status byte with the lower nibble set to zero.""" . midi:velocity a rdf:Property ; rdfs:range xsd:byte ; rdfs:comment "The velocity of a note message (0 to 127)." .