spessasus / SpessaSynth

MIDI SoundFont/DLS synthesizer library written in JavaScript.
https://spessasus.github.io/SpessaSynth/
Other
96 stars 12 forks source link

odd playback of release samples in GeneralUser GS 2.0.0 clavinet #52

Closed mrbumpy409 closed 1 month ago

mrbumpy409 commented 1 month ago

Version

github.io page, v3.20.35

Description

In a SoundFont, release samples are created by looping a tiny bit of silence at the start of a sample, and then setting the loop mode to escape the loop on note release. This results in a "release sample" of sorts, since you only hear the sound when you release the key.

To create the note release noises in the Clavinet for GeneralUser GS 2.0.0, I added a silent loop to the beginning of the normal samples, which then use a super short release time to just barely play the noise at the beginning of the sample upon note release.

In SpessaSynth, this works fine if the note is held down a little bit before release, but if the note is staccato, it appears the volume envelope release time is elongated. In this particular instrument, this results in too much of the sample being played on note release, which sounds like a separate note-on event that is out of tune.

Reproduction steps

  1. Download the attached SoundFont: GeneralUser GS 2.0 Clavinet.zip
  2. Inside the SoundFont are two presets: 000:000 Clavinet-normal (the normal Clavinet instrument with release noises) and 000:001 Clavinet-release (just the release noise layer).
  3. With live MIDI input routed to channel 1, load the 000:001 Clavinet-release preset.
  4. Play notes of varying duration and observe the sound produced when releasing the key.

Expected behavior

Apart from volume, there should be no difference in the sound of the release noise, regardless of note duration.

Actual behavior

Notes played staccato result in more of the sample being played than intended, which ends up sounding like an out-of-tune staccato clavinet note. It would appear the specified volume envelope release time is not being honored for short notes.

MIDI files and SoundFonts

GeneralUser GS 2.0 Clavinet.zip

Additional context

You can use Polyphone (recent/latest version ideally) or FluidSynth to hear how these presets should sound. You can also reference this video at timestamp 5:13.

spessasus commented 1 month ago

I've fixed it now, it was an issue with the looping mode 3 release starting too early. Thanks for the report!

mrbumpy409 commented 1 month ago

Just tested and I can confirm the issue is fixed. Thank you!