Environment: Siren
MIDIDevice is a subclass of Model whose instances are used to model MIDI input/output hardware devices.
Instance variables:
Class variable:
Standard MIDI Commands:
Relevant Constants for description of MIDI commands:
accessing
port
stream
debug
MStream
Note On = 9n kk vv
Note Off = 8n kk vv
Key Pressure = An kk vv
Pitch Wheel = En ll ll
After Touch Channel Pressure = Dn vv
Control Change = Bn cc vv
Program change = Cn pp
n = 4-bit channel number
kk = 7-bit key number
vv = 7-bit key velocity
ll = 7-bit low-order value
hh = 7-bit high-order value
cc = 7-bit control number
pp = 7-bit program number
port: aPort
Set the receiver's I/O port.
stream
Answer the receiver's MIDI stream ID.
stream: aNumber
Set the receiver's MIDI stream ID.
initialization
Ensure that the receiver's output port is initialized.
close
Release the receiver's hold on the port.
initialize
Set the receiver up on the default output port.
initialize: thePort
Set the receiver up on the given output port.
play: anAss on: channelNumber
play the given event on my port as a default MIDI noteOn/noteOff pair
note events
Play the given event on my port as a default MIDI noteOn/noteOff pair.
parameter mapping
Map a numerical or symbolic amplitude to a MIDI-compatible
volume number (key velocity)
mapDuration: aVal
Map a numerical or symbolic duration value to a
MIDI-compatible duration in msec.
mapPitch: aVal
Map a numerical or symbolic pitch to a MIDI-compatible note number.
mapVoice: aVal
Map a numerical or symbolic pitch to a MIDI-compatible note number.
MetaClass: MIDIDevice class
examples
Play a note out MIDI from the device level.
scheduleExample
Play MIDI using the event scheduler.
instance creation
Open a generic MidiDevice on the default Port
on: port
Open a generic MidiDevice on the given Port
class initialization
Set up the one class variable