MidiOutCtrl

Send a MIDI Control Message to any MIDI device

The MidiOutCtrl widget sends MIDI Control messages via OSC to the MediaControl application, typically used to control MIDI software such as Live or MAX/MSP. Messages are sent every time a different value is received, where the value is used for the value of the control message, and the channel and control number are set in the widget.

Alternatively, code can use the widget to send any control message with the sendMidiCtrl() function.

MidiOutputCtrl works with the NETLab MediaControl application, and MediaControl must be running.

On Screen Features

  • IN:Shows the values coming from the inputSource as well as the instance name of the inputSource
  • CH: Sets the MIDI channel for the message.
  • NUM: Sets the MIDI controller number for the message.
  • VALUE: Shows the output value that will be part of the MIDI control message as the value. The button determines if the widget is listening to the input. Turning this off can be helpful to prevent too many MIDI messages being sent while testing.
  • SEND TEST CTRL MESSAGE: Sends a test control message with a value of 127. Typically used to make sure MIDI is being received by an application. Also used to set a particular part of a MIDI application (like LIVE) to listen to that MIDI control message.

Parameters

  • INPUT SOURCE: The instance name of the source the widget listens to, e.g AnalogIn or DigitalIn
  • INVISIBLE: If set to “yes”, the widget will disappear when the Flash movie is run
  • MEDIACONTROL IP: Sets the IP address for the MediaControl application being communicated with. Typically set to 127.0.0.1 to communicate with other applications running on the same computer
  • MEDIACONTROL PORT: Sets the communication port for the MediaControl application being communicated with. When communicating with MediaControl, the default port is 51010.

Code Interface

sendMidiCtrl(controllerValue, controllerNum, midiChannel)

// assuming the MidiOutputCtrl widget has an instance name of ctrlOut
   // and this code is running at the _root level
   // send a midi control message on channel 2, controller 7 (volume), value 120
   // note: values must be between 0 and 127
   // sendMidiCtrl(controllerValue, controllerNum, midiChannel)

   myMidiCtrlOut.sendMidiCtrl(120, 7, 2);

   // alternatively, send only the controller value,
   // using the channel and controller numbers set in the widget
   // this version uses the existing values for channel num and controller num
   myMidiCtrlOut.sendMidiCtrl(120,null,null);

connectWidget()

Causes the widget to connect to the controller, the same result as using the connect button.

myMidiCtrlOut.connectWidget();

disconnectWidget()

Causes the widget to connect to the controller, the same result as using the connect button.

myMidiCtrlOut.disconnectWidget();

Last modified May 19th, 2012