Channel-specific MIDI operations
- Source:
Members
(static) allNotesOff
Send All Notes Off message (CC 123, value 0)
- Source:
(static) allSoundsOff
Send All Sounds Off message (CC 120, value 0)
- Source:
Examples
// Stop all sounds on channel 1
midi.channel.allSoundsOff(1);
// Send to all channels
midi.channel.allSoundsOff();
(static) getCC
Get current value of a CC
- Source:
Example
const volume = midi.channel.getCC(7);
if (volume !== undefined) {
console.log(`Current volume: ${volume}`);
}
(static) getMonoPressure
Get current channel pressure for a channel
- Source:
(static) getPC
Get current program for a channel
- Source:
(static) getPitchBend
Get current pitch bend value for a channel
- Source:
(static) getPolyPressure
Get current polyphonic pressure for a note on a channel
- Source:
(static) localControl
Send Local Control On/Off message (CC 122)
- Source:
Example
// Turn off local control on channel 1
midi.channel.localControl(false, 1);
(static) monoOn
Send Mono Mode On message (CC 126)
- Source:
(static) omniOff
Send Omni Mode Off message (CC 124, value 0)
- Source:
(static) omniOn
Send Omni Mode On message (CC 125, value 0)
- Source:
(static) polyOn
Send Poly Mode On message (CC 127, value 0)
- Source:
(static) resetControllers
Send Reset All Controllers message (CC 121, value 0)
- Source:
(static) sendCC
Send a control change message
- Source:
Examples
// Set volume (CC 7) to 100 on default channel
midi.channel.sendCC(7, 100);
// Set filter cutoff (CC 74) to 64 on channel 2
midi.channel.sendCC(74, 64, 2);
(static) sendMonoPressure
Send a channel pressure (aftertouch) message
- Source:
Example
// Send channel pressure at max (127)
midi.channel.sendMonoPressure(127);
(static) sendNoteOff
Send a note off message
- Source:
Example
// Stop middle C
midi.channel.sendNoteOff(60);
(static) sendNoteOn
Send a note on message
- Source:
Examples
// Play middle C (60) with velocity 100
midi.channel.sendNoteOn(60, 100);
// Play note 64 (E4) on channel 5
midi.channel.sendNoteOn(64, 80, 5);
(static) sendPC
Send a program change message
- Source:
Example
// Change to program 5 on default channel
midi.channel.sendPC(5);
(static) sendPitchBend
Send a pitch bend message
- Source:
Examples
// Bend pitch up (value > 8192)
midi.channel.sendPitchBend(10000);
// Return to center (no bend)
midi.channel.sendPitchBend(8192);
(static) sendPolyPressure
Send a polyphonic key pressure (polyphonic aftertouch) message
- Source:
Example
// Send poly pressure for middle C
midi.channel.sendPolyPressure(60, 100);