Main Content

MIDI Controls

Output values from controls on MIDI control surface

  • Library:
  • Audio Toolbox / Sources

    DSP System Toolbox / Sources

  • MIDI Controls block

Description

TheMIDI Controlsblock outputs values from controls on a MIDI control surface in real time. Use the MIDI Controls block to interact with your audio processing model.

The MIDI Controls block combines the functionality of the general MIDI functions in MATLAB®:midicontrols,midiread,midisync. Use the MATLABmidiidcommand to discover MIDI device names or MIDI device control numbers.

Ports

Output

expand all

输出的大小MIDI Controlsblock is determined by theMIDI controlsandMIDI control numbersparameters.

The output data type is determined by theOutput modeparameter.

Data Type Output Mode
double Normalized (0-1)
uint8 生MIDI (0 - 127)

Data Types:double|uint8

Parameters

expand all

To set the default MIDI device, use thesetpreffunction. For example, if the device is namedBCF2000, at the MATLAB command line, enter:

setpref('midi','DefaultDevice','BCF2000');

The MIDI device name is assigned by the device manufacturer or host operating system, and specified as a character vector. Usemidiid交互式identify your MIDI device.

To enable this parameter, setMIDI devicetoSpecify other.

This parameter also determines the size of the block output port. If you chooseRespond to any control, then the block output is a scalar corresponding to the value of the most recently manipulated control.

Usemidiid交互式identify the control numbers of your MIDI device. This parameter is available when you setMIDI controlstoRespond to specified controls.

If you specifyInitial valuesas a scalar, all controls specified byMIDI control numbersare assigned that value.

If you specifyInitial valuesas an array, the array must be the same size asMIDI control numbers.

选择该参数同步ize a MIDI device with values specified by theInitial valueswhen simulation starts. If your MIDI device can receive and respond to messages, it adjusts its controls as specified. This parameter is valid only whenMIDI controlsis set toRespond to specified controls.

Many MIDI devices are not bidirectional. Selecting this parameter with a unidirectional device has no effect. TheMIDI Controlsblock cannot tell whether a value is successfully sent to a device or even whether the device is bidirectional. If sending a value fails, no errors or warnings are generated.

Output mode for MIDI control value, specified asNormalized (0-1)or生MIDI (0 - 127).

Block Characteristics

Data Types

double|integer

Direct Feedthrough

no

Multidimensional Signals

no

Variable-Size Signals

no

Zero-Crossing Detection

no

Tips

  • TheMIDI Controlsblock is not supported for rapid accelerator mode.

Extended Capabilities