Skip to content

Instantly share code, notes, and snippets.

@alexeybondarenko
Last active August 8, 2017 20:28
Show Gist options
  • Save alexeybondarenko/2bda1f2ca8ab7f2dcb39e9785cde0fa8 to your computer and use it in GitHub Desktop.
Save alexeybondarenko/2bda1f2ca8ab7f2dcb39e9785cde0fa8 to your computer and use it in GitHub Desktop.
function playSound(audioBuffer) {
var source = context.createBufferSource();
source.buffer = audioBuffer;
source.connect(context.destination);
source.start(0);
console.timeEnd('send');
}
function handleMidiMessage(e) {
if (!MIDIStream || e.data[0] !== 0x90) return;
console.log(e);
console.time('send');
MIDIStream.write(e.data);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment