cwilso / MIDIDrums

MIDI version of Shiny Drum Machine
MIT License
345 stars 124 forks source link

midi.js problem #3

Closed yogibooboo closed 9 years ago

yogibooboo commented 9 years ago

I have downloaded your application since it looks as a good tutorial for web midi implementations. Unfortunately I was not able to get midi input events, while running it on the web (http://webaudiodemos.appspot.com/MIDIDrums/index.html) it works correctly. I have found a difference in the midi.js file, in the onMIDIInit function. This is the working version;

if (!midiIn) {
  midiIn = midiAccess.inputs.values().next().value;
  midiIn.onmidimessage = midiMessageReceived;
}
var outputs=midiAccess.outputs.values();

and this is the GitHub version:

if (!midiIn)
  midiIn = midiAccess.inputs.values().next().value;
var outputs=midiAccess.outputs.values();

the onmidimessage method is missing.

Thanks anyway for posting this great application!

cwilso commented 9 years ago

Fixed by https://github.com/cwilso/MIDIDrums/commit/889f999a1043634d5885f3ed31dd0823533db05c.