Skip to content

sending CC messages #275

Answered by djipco
Tomartsh asked this question in Q&A
Jun 27, 2022 · 1 comments · 1 reply
Discussion options

You must be logged in to vote

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:

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 console.log(WebMidi.outputs)

Here's a second example that sends a chorus level control chan…

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@Tomartsh
Comment options

Answer selected by Tomartsh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants