Last active
August 8, 2017 20:25
-
-
Save alexeybondarenko/7e2f60802827516d9531b74c65984af1 to your computer and use it in GitHub Desktop.
Tutorial. How to create MIDI synthesizer with MIDI API and Node JS https://medium.com/nebo-15/tutorial-how-to-create-midi-synthesizer-with-midi-api-and-node-js-48d41c162009
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WEBSOCKETS | |
var socketUrl = 'ws://' + location.hostname + ':3001'; | |
var client = new BinaryClient(socketUrl); | |
var MIDIStream = null; | |
client.on('open', function () { | |
MIDIStream = client.createStream(); | |
MIDIStream.on('data', handleReceiveAudioData); | |
MIDIStream.on('end', handleEndAudioStream); | |
}); | |
function handleReceiveAudioData(data) { | |
console.log('receive audio data', data); | |
} | |
function handleEndAudioStream(data) { | |
console.log('end', data); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment