0

There is the code for sending a note to midiOutput:

navigator.requestMIDIAccess()
  .then(function(midiAccess) {
    const outputs = midiAccess.outputs.values();
    const inputs = midiAccess.inputs.values();
    console.log(outputs);
    for(const output of outputs) {
      console.log(output);
        midiOutput = output;
    }

    
    midiOutput.send([NOTE_ON, sequence[currentSequenceId], 0x7f]);

  });

How can I send a joystick MIDI CC 1 Modulation Wheel and Pitch Wheel messages with Web MIDI API?

mr_blond
  • 1,586
  • 2
  • 20
  • 52

1 Answers1

0

MIDI messages are defined in the MIDI specification.

modwheel = 42;
midiOutput.send([0xB0, 1, modwheel]);

pitch = 8192 + 42;
pitch_lsb = pitch & 0x7f;
pitch_msb = pitch >> 7;
midiOutput.send([0xE0, pitch_lsb, pitch_msb]);
CL.
  • 173,858
  • 17
  • 217
  • 259