MIDIMessageDispatcher:
Filter:
Classes | External Control > MIDI > Dispatchers

MIDIMessageDispatcher : AbstractWrappingDispatcher : AbstractDispatcher : Object

The default dispatcher for MIDIFunc's and MIDIdef's set to respond to noteOn, noteOff, control, and polytouch messages.

Description

MIDIMessageDispatcher is used to dispatch incoming MIDI noteOn, noteOff, control, and polytouch messages to matching functions. Normally users should not have to create or message instances of this class directly.

Class Methods

MIDIMessageDispatcher.new(messageType)

Create a new instance.

Arguments:

messageType

A Symbol indicating the message type, one of \noteOn, \noteOff, \control, or \polytouch.

Returns:

A new MIDIMessageDispatcher.

Inherited class methods

Instance Methods

.messageType = value

Get this dispatcher's message type, one of \noteOn, \noteOff, \control, or \polytouch.

Returns:

A Symbol.

.getKeysForFuncProxy(funcProxy)

Get the keys at which a responder func's functions are stored in this dispatcher's active dictionary. The keys will be MIDI message numbers.

Arguments:

funcProxy

The MIDIFunc or MIDIdef whose keys should be returned.

Returns:

An Array containing the funcProxy's message number as an Integer.

.value(src, chan, num, val)

Attempt to match an incoming MIDI message with this dispatcher's responder funcs, and evaluate their functions for all matches found.

Arguments:

src

The UID of the source of the MIDI message as an Integer.

chan

The channel number of the MIDI message as an Integer. Note this should be in the range 0-15.

num

The message number (e.g. note number, etc.) of the MIDI message as an Integer. Note this should be in the range 0-127.

val

The message value (e.g. velocity, etc.) of the MIDI message as an Integer. Note this should be in the range 0-127.

.register

Adds this dispatcher to the appropriate receive hook in MIDIIn.

.unregister

Removes this dispatcher from the appropriate receive hook in MIDIIn.

.wrapFunc(funcProxy)

Called internally to wrap functions in message matcher objects, if needed.

Arguments:

funcProxy

An instance of MIDIFunc or MIDIdef whose function(s) are to be wrapped.

.typeKey

Gets a key indicating the type of message this dispatcher responds to, in the form: ('MIDI ' ++ messageType).asSymbol.

Returns:

A Symbol.

Inherited instance methods