Skip to content
This repository has been archived by the owner on May 2, 2022. It is now read-only.

ResidentSf2Synth: Bad noteOn/noteOff responses #31

Open
notator opened this issue Jun 16, 2017 · 0 comments
Open

ResidentSf2Synth: Bad noteOn/noteOff responses #31

notator opened this issue Jun 16, 2017 · 0 comments

Comments

@notator
Copy link
Owner

notator commented Jun 16, 2017

From WebMIDISynthHost issue #6:

  1. Start the WebMIDISynthHost application,
  2. Select the ResidentSf2Synth synthesizer
  3. Using the default "grand piano" preset, send the default noteOn.

There is a delay before the synth responds to the first noteOn. Why?

Even when the noteOn is reponding correctly, the noteOff does not respond immediately if it comes too soon. Why?
.................

I've now solved both these issues, but have been unable to discover why the first noteOn is delayed, and my solution to the noteOff problem is also not entirely satisfactory.

My kludge for the delayed NoteOn problem is as follows:
When the first soundfont has loaded:

  1. set the first synth's master volume to 0.
  2. set its soundFont to the first soundFont
  3. send a dummy noteOn/noteOff pair
  4. after ca.2 seconds, reset the master volume and tell the host that the font has loaded.
    Not nice, but it works. I think there may be an uninitialized buffer somewhere, but have been unable to find it...

NoteOffs now end the sound much earlier.
In the original gree code, notes stop sounding instrument.volRelease seconds after the noteOff arrives.
In the Arachno font, instrument.volRelease is 3.08 in preset 0 (grand piano).
It cannot be the case that a piano note only stops 3.08 seconds after a noteOff arrives. Multiplying the instrument's volRelease and modRelease attributes by 0.1 sounds much more realistic...
This is probably not the correct, official solution, but it produces acceptable behaviour for all the presets I've tried. Anyone know what that correct solution is?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant