mscuthbert / midicube

MIDI-apps with soundfonts and players on the web. Built off of mudcube/MIDI.js (abandonware) but in ES6 etc.
MIT License
50 stars 9 forks source link

Wrong instruments #3

Open page200 opened 1 year ago

page200 commented 1 year ago

When I tried midicube as well as https://github.com/gleitz/MIDI.js in December or earlier, they played wrong instruments for some (many?) MIDI files that have several instruments. Did recent commits fix this?

This problem isn't present in the abcjs branch of the original MIDI.js.

page200 commented 1 year ago

This problem of all branches except abcjs as well as other problems of the abcjs branch are discussed here: https://github.com/mudcube/MIDI.js/issues/268

mscuthbert commented 1 year ago

Can you explain the problem w/ a bit more detail -- what are you doing and what instruments load instead? The branches work fine for me. Thanks!

page200 commented 2 months ago

I modified MIDIPlayer.html such that it plays passport.mid (precisely the version available for example here, converted to base64 and put into the song variable) using SoundFonts from https://gleitz.github.io/midi-js-soundfonts/.

The instruments and tempo are wrong. For example, instead of Slap Bass 1, something like a vibraphone plays.

Have you tried passport.mid?

mscuthbert commented 2 months ago

I definitely know PASSPORT.MID (I'm old -- I remember when it was new) -- can you paste the midicube code you are using to load it and playback.

It is also possible that there is a 1-based GM instrument encoding going on and each of the instruments is off by one? This is a problem in a lot of very old MIDI files which used 1-127 instead of 0-127.

mscuthbert commented 2 months ago

None of the instrument numbering/playing code has changed since MIDI.js -- that was not the reason for the fork, only to maintain the system. Note that none of MIDI.js or midicube (here) were optimized for midi-file playing - so there are lots of MIDI features (modulations, sysex, etc.) that don't work on MIDI.js -- one of the key features was just receive-MIDI note -> play MIDI note.

page200 commented 2 months ago

can you paste the midicube code you are using to load it and playback.

That version of MIDIPlayer.html is attached here. I modified this file in this 2019 version of midicube: https://github.com/mscuthbert/midicube/commit/a652051de318edd02cecd0ab78aae570216624d3 (which was the latest version when I tried in 2022).

The modification is that it has passport.mid and SoundFonts from https://gleitz.github.io/midi-js-soundfonts/.