WebMIDISynthHost icon indicating copy to clipboard operation
WebMIDISynthHost copied to clipboard

ResidentSf2Synth: First notes are silent after synth initialisation

Open notator opened this issue 8 years ago • 0 comments

This problem ~~may be~~ is related to issue:

Go to http://james-ingram-act-two.de/open-source/assistantPerformer/assistantPerformer.html Select Pianola Music 1967 (scroll) as the score and Resident Sf2 Synth as the output device. Click the Start button. The score appears with a set of performance controls along the top of the page. Click the green 'Go' button. Bug: The first chords are silent, but notes soon start sounding. Stop the performance by clicking the red 'Stop' button. Then restart by pressing the 'Go' button again. The score restarts from the green start-marker and this time the first notes sound (correctly).

I think this is an initialisation problem... Probably the synth's init() function needs changing somehow...

This problem does not occur when using the Virtual MIDI Synth.

.........

I've added a similar kludge to the Assistant Performer's Controls.init() function. This simply sends a dummy noteOn/noteOff pair to each channel (except the percussion channel 9 - which is not used) immediately after the synth has loaded the soundfont. Somehow it must be possible to initialize the buffers some other way, but I have been unable to find out how, even after studying the docs at https://developer.mozilla.org/en-US/docs/Web/API/AudioContext The synth uses samples contained in the soundFont's instruments as AudioBufferSourceNode buffers. See sf2synth1/SoundFontSynthNote.prototype.noteOn(...)

notator avatar Jun 16 '17 11:06 notator