Closed page200 closed 1 year ago
https://surikov.github.io/webaudiofont/examples/midiplayer.html - a small example of using WrebAudioFont. WebAudioFont is an engine for playing music, not for parsing music files. Write your own MIDI parser if you need to parse a "pitch-bend" event in a special way.
Thank you for the quick reply! :)
The example MIDI file parser at https://github.com/surikov/webaudiofont/blob/master/examples/MIDIFile.js#L1020, instead of dividing by 6
, should divide by 64
and multiply by the number of semitones of the pitch-bend range (2
per default, or otherwise set via specific RPN messages, usually followed by specific "Data Entry" messages: http://midi.teragonaudio.com/tech/midispec/rpn.htm).
It would be great if you could fix this. Otherwise even the pitch bends in the demo song from "The Good, the Bad and the Ugly" on your page are affected.
Author of MIDIFile.js is https://github.com/nfroidure Ask him to modify his parser. You can use any other parser.
Again WebAudioFont is an engine for playing music, not for parsing music files.
Neither https://github.com/nfroidure/midifile nor its ahead forks (nor its accompanying repos https://github.com/nfroidure/midievents (which is also part of your MIDIFile.js) and https://github.com/nfroidure/midiplayer) seem to have slides
(pitch bends) or parseSong
. Maybe you had implemented that. So I made a pull request for your repo rather than for the original MIDIFile.js
The author of the original MIDIFile.js repo welcomes a pull request with the updates that are unique to your repo (slides
(pitch bends), parseSong()
, ...).
You're most qualified for this because you wrote the updates, and because you'll be able to simultaneously turn MIDIFile.js in your repo into an external dependency, so the repos won't get out of sync. But maybe someone else can make the pull request, too.
I uploaded passport.mid to https://surikov.github.io/webaudiofont/examples/midiplayer.html and the pitch bends (for example played in the last non-drum channel around the 92% progress mark, i.e. at time 1:51) sound different than in non-web MIDI players. Maybe the pitch-bend value gets multiplied by a wrong factor or so.