mudcube / MIDI.js

:musical_keyboard: Making life easy to create a MIDI-app on the web. Includes a library to program synesthesia into your app for memory recognition or for creating trippy effects. Convert soundfonts for Guitar, Bass, Drums, ect. into code that can be read by the browser. Supports multiple simultaneous instruments and perfect timing.
http://mudcu.be/midi-js/
MIT License
3.8k stars 641 forks source link

Is it possible to use MIDI.Player without a soundfont? #111

Closed bthj closed 9 years ago

bthj commented 9 years ago

Hi, I'm wondering if it is possible to use the MIDI.Player without loading a SoundFont?

Just need the note information for each note played in a MIDI file, via a callback in:

MIDI.Player.addListener(...)

Tried something like:

MIDI.loadPlugin(function() {

  player = MIDI.Player;
  player.loadFile( song[songid], player.start );

  player.addListener( midiNotePlayedCallback );

  MIDI.loader.stop();
});

but get back a Cross origin error (from a request for a SoundFont file that I don't need).

P.s. Asked a similar question here: http://stackoverflow.com/questions/27192728/receive-note-events-from-a-midi-file-with-javascript

hellopath commented 9 years ago

I was coming to ask the same question. Did you find any way for that @bthj ?

Thanks

bthj commented 9 years ago

Nope, I haven't yet found a way to do that.

mudcube commented 9 years ago

Not unless you're on the Chrome Canary and have WebMIDI flag enabled.