djipco / webmidi

Tame the Web MIDI API. Send and receive MIDI messages with ease. Control instruments with user-friendly functions (playNote, sendPitchBend, etc.). React to MIDI input with simple event listeners (noteon, pitchbend, controlchange, etc.).
Apache License 2.0
1.53k stars 115 forks source link

output.stopNote("all") does not work as expected #163

Closed joeljansonjohansen closed 2 years ago

joeljansonjohansen commented 2 years ago

Describe the bug and how to reproduce it Using this command does not stop any of the notes playing. For example:

Starting a note with: output.playNote("A3", 1);

And trying to end it with: output.stopNote("all", 1, { time: "+2000" });

Does not work, however, this works: output.stopNote("A3", 1, { time: "+2000" });

Environment: Specify the environment where you are witnessing the problem: Mac Big Sur Chrome 93.0.4577.82 Webmidi - 2.5.3

djipco commented 2 years ago

And trying to end it with: output.stopNote("all", 1, { time: "+2000" });

The first parameter of the stopNote() method is a string that identifies a note and octave. The string "all" is not allowed in this context. However, maybe adding a stopAllNotes() would be a worthy addition to the library. I've added that to the list of enhancements to evaluate.