Jazz-Soft.net
We make it sound!
Home » Documentation » Jazz-Plugin » Reference » MidiOut()

MidiOut()

Function

MidiOut ( byte1, byte2, byte3 ) - send standard MIDI message of 3 bytes.

byte1 (0x80 to 0xEF) is MIDI control code, where higher 4 bits define the function, and lower 4 bits stand for one of 16 MIDI channels.

byte2 and byte3 (0 to 127) are additional parameters depending on the control code.

Most commonly used messages are:

Whole chart of MIDI messages is available at MIDI Manufacturers Association's website.

If byte3 is not used, set it to zero.

Example

Jazz.MidiOut(0xC0,40,0);                                       // set violin sound on MIDI channel 0
Jazz.MidiOut(0x90,60,100);                                     // start playing middle-C note
window.setTimeout(function(){ Jazz.MidiOut(0x80,60,0);},500);  // stop playing the note after half second

See also