Subject: Re: [linux-audio-user] fluidsynth: Sustain bug ?
From: Joerg Anders (j.anders_AT_informatik.tu-chemnitz.de)
Date: Fri Sep 05 2003 - 18:55:06 EEST
On Fri, 5 Sep 2003, Julien Claassen wrote:
First of all: Thank you for giving me a pointer into the fluidsynth program.
> I just looked it up again. You go into your directory src, then you edit the
> file: fluid_voice.c.
> There you go to line 1372 (for version 1.0.3) and there you'll find:
> count = calculate_hold_decay_buffers(voice, GEN_VOLENVDECAY,
> GEN_KEYTOVOLENVDECAY, 1); /* 1 for decay */
> After this line you can directly insert something like:
> if (count <98) count = 98;
This didn't help but I changend in line 1362 after:
case GEN_VOLENVHOLD: /* SF2.01 section 8.1.3 # 35 */
case GEN_KEYTOVOLENVHOLD: /* SF2.01 section 8.1.3 # 39 */
count = calculate_hold_decay_buffers(voice, GEN_VOLENVHOLD, GEN_KEYTOVOLENVHOLD, 0); /* 0 means: hold */
if (count < 98) count = 1771;
^^^^^
Now the strings hold the tone but there is a small problem in release.
I assume I could fix this similary. But more interesting is: I printed out the "count" values at
GEN_VOLENVHOLD
GEN_VOLENVDECAY (GEN_VOLENVSUSTAIN, GEN_KEYTOVOLENVDECAY)
GEN_MODENVRELEASE
If I play the strings (program number 48 in GM scale) the values are:
GEN_MODENVRELEASE: 1191
GEN_VOLENVHOLD: 1771
GEN_VOLENVDECAY: 1771
If I do the same wit choir A (program number 52 in GM scale) the values are:
GEN_MODENVRELEASE: 728
GEN_VOLENVHOLD: 792
GEN_VOLENVDECAY: 19464
The difference is surprising because the strings and the choirA have certainly a
similar envelope.
Therefore I changed again at:
case GEN_VOLENVHOLD: /* SF2.01 section 8.1.3 # 35 */
case GEN_KEYTOVOLENVHOLD:
count = calculate_hold_decay_buffers(voice, GEN_VOLENVHOLD, GEN_KEYTOVOLENVHOLD, 0); /* 0 means: hold */
if (count < 98) count = 19464;
^^^^^
and at:
case GEN_VOLENVDECAY: /* SF2.01 section 8.1.3 # 36 */
case GEN_VOLENVSUSTAIN: /* SF2.01 section 8.1.3 # 37 */
case GEN_KEYTOVOLENVDECAY: /* SF2.01 section 8.1.3 # 40 */
count = calculate_hold_decay_buffers(voice, GEN_VOLENVDECAY, GEN_KEYTOVOLENVDECAY, 1); /* 1 for decay */
if (count < 2000) count = 19464;
^^^^ ^^^^^
... and the strings are still too quietly but if I increase the volume of the single NOTE_ON commands the strings
sound (almost) like on hardware wavetable synthesizer (with small distortions).
Because of the great differences (1771 << 19464) I assume still a SF2 interpretation error.
Feel free to give me instructions about what else shall I test.
-- J.Anders, Chemnitz, GERMANY (ja_AT_informatik.tu-chemnitz.de)
This archive was generated by hypermail 2b28 : Fri Sep 05 2003 - 19:17:31 EEST