Return most recent value of MIDI controls




v = midiread(h) returns the most recent value of the MIDI controls associated with midicontrols object, h. You must create h first before it can determine the values of its MIDI controls if they are moved. Calling midiread before the controls are moved, returns the initial values specified to midicontrols. In this case, when h is created. (or 0 if no initial values are specified).


expand all

Read Control Values

h = midicontrols;
v = midiread(h);

Input Arguments

expand all

h — Object that listens to the controls on a MIDI deviceobject

h is an object that listens to the controls on a MIDI device.

Output Arguments

expand all

v — Most recent value of MIDI controlsany numeric value

The output value depends on the OutputMode specified by midicontrols when h is created. If you specify that the OutputMode is normalized, then the midiread returns output values in the range [0 1]. Also, initial values are quantized and may be slightly different from those specified by midicontrols.

If you specify the mode as rawmidi, then midiread returns integer values in the range [0 127], and no quantization is required. If you do not specify the OutputMode, the default is normalized.

Example: 0.3 or [0 0.3 0.6]

Data Types: double | uint8

Was this topic helpful?