TinySoundFont icon indicating copy to clipboard operation
TinySoundFont copied to clipboard

modulation envelope attack is wrong curve and duration

Open mrbumpy409 opened this issue 4 months ago • 0 comments

I ran the SoundFont Spec Implementation Test and found an issue with TinySoundFont's modulation envelope. Here are the details for the modulation envelope test, copied from the test documentation:

Test #2: Modulation envelope

This test uses all six envelope stages, each lasting exactly 1 second. The stages are delay, attack, hold, decay, sustain, and release. The attack should be a convex curve, while the remaining envelope stages should all be linear. You should hear the note's pitch change according to the following envelope shape:

        ____
       /    \
      /      \____
     /            \
____/              \

I viewed the test recording in Audacity using spectrogram view (TinySoundFont on top, FluidSynth on bottom):

image

This is zoomed in to show the attack, hold, and decay phases. You can see by the time ruler at the top, FluidSynth's attack is a convex curve and lasts for exactly one second (10.5 to 11.5), which is correct. TinySoundFont, however, uses a linear curve, and only lasts for about 0.14 seconds. The hold and decay phases are the correct durations, but due to the shortened length of the attack curve, they now occur too early in the sound.

mrbumpy409 avatar Oct 14 '24 16:10 mrbumpy409