MATLAB Examples

Output Values from MIDI Control Surface

The example shows how to set the MIDI Controls block parameters to output control values from your MIDI device.

1. Connect a MIDI device to your computer and then open the model.

2. Run the model with default settings. Move any controller on your default MIDI device to update the Display block.

3. Stop the simulation.

4. At the MATLAB™ command line, use midiid to determine the name of your MIDI device and two control numbers associated with your device.

5. In the MIDI Control block dialog box, set MIDI device to Specify other and enter the name of your MIDI device.

6. Set MIDI controls to Respond to specified controls and enter the control numbers determined using midiid.

7. Specify initial values as a vector the same size as MIDI control numbers. The initial values you specify are quantized according to the MIDI protocol and your particular MIDI surface.

The dialog box shows sample values for a 'BCF2000' MIDI device with control numbers 1081 and 1083.

8. Click OK, and then run the model. Verify that the Display block shows initial values and updates when you move the specified controls.