-
Hi, I may be wrong as I am a newbie, but I did not see an example or documentation concerning sending out CC messages. Is there such an example ? Many thanks in advance, |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You are right that there is no such example. However, the documentation for Output.sendControlChange() and OutputChannel.sendControlChange() does detail how to do it. Here's an example that sends a coarse volume control change message to all channels of an WebMidi
.enable()
.then(()=> {
const device = WebMidi.getOutputByName("Some device..."); // "device" references an 'Output' object
device.sendControlChange("volumecoarse", 64);
}); Of course, you need to change "Some device..." by the name of a device available on your system. A list of available devices can be obtained with Here's a second example that sends a chorus level control change message to MIDI channel 10 of a specific WebMidi
.enable()
.then(()=> {
const device = WebMidi.getOutputByName("Some device...");
const instrument = device.channels[10]; // "instrument" references an 'OutputChannel' object
instrument.sendControlChange("choruslevel", 127);
}); Hope this helps! |
Beta Was this translation helpful? Give feedback.
You are right that there is no such example. However, the documentation for Output.sendControlChange() and OutputChannel.sendControlChange() does detail how to do it.
Here's an example that sends a coarse volume control change message to all channels of an
Output
:Of course, you need to change "Some device..." by the name of a device available on your system. A list of available devices can be obtained with
console.log(WebMidi.outputs)
Here's a second example that sends a chorus level control chan…