Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Clearing MIDI output buffer

Using the Web MIDI API, I can send some messages:

// Note on
output.send([0x90, 0x20, 0x50]);

I can also schedule some messages to be well-timed and sent in the future:

// Note off, 1 second later
output.send([0x80, 0x20, 0x40], performance.now() + 1000);

Now, suppose I've scheduled many messages to be sent in the future over several seconds, and now I want to cancel the sending of those messages. According to the spec, I should be able to call clear on the output:

output.clear();

However, this is undefined on Chrome (at least as of v79).

Uncaught TypeError: output.clear is not a function

I assume this part just isn't implemented yet. Is that the case? And if so, is there some alternative I can use today?

like image 539
Brad Avatar asked Jan 30 '20 17:01

Brad


1 Answers

It is indeed not yet available. You can follow this issue to get updated of any advancements.

Note that Firefox has a flag to allow the Web Midi API, might worth a try to see if they do handle it.

like image 107
Kaiido Avatar answered Oct 04 '22 05:10

Kaiido