On Fri, 28 Nov 2003, Chris Cannam wrote:
I still don't quite understand what you mean by
this. What is the
actual problem, in terms of what you hear? How does a faulty string
envelope sound?
TiMidiy and all other synthezizers produce a long string tone
from 8mbgmsfx.sf2 soundfont if I tie 4 or 5 whole notes.
/---------------------------------------------.......
/
|
|
|
|
|
|
\
\---------------------------------------------- .......
FluidSynth produces such an envelope:
/---\
/ \
| \
| \ ---------------------------------------- ...
|
| /---------------------------------------- ...
| /
| /
\ /
\---/
I routinely use Fluidsynth with strings and haven't noticed any
particular problems, except that most freely available soundfonts
have rather too obvious short loops for their string samples. Is it
something particular to the soundfont you're using?
I use the 8mbgmsfx.sf2 soundfont which was shipped with some
soundcards.
As already mentioned: I know how to "fix" this:
diff -au fluidsynth-1.0.3/src/fluid_voice.c.ori fluidsynth-1.0.3/src/fluid_voice.c.new
--- fluidsynth-1.0.3/src/fluid_voice.c.ori 2003-11-26 12:39:45.000000000 +0100
+++ fluidsynth-1.0.3/src/fluid_voice.c.new 2003-11-26 12:30:25.000000000 +0100
@@ -1359,6 +1359,7 @@
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 = 19464;
voice->volenv_data[FLUID_VOICE_ENVHOLD].count = count;
voice->volenv_data[FLUID_VOICE_ENVHOLD].coeff = 1.0f;
voice->volenv_data[FLUID_VOICE_ENVHOLD].incr = 0.0f;
@@ -1370,6 +1371,7 @@
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;
voice->volenv_data[FLUID_VOICE_ENVDECAY].count = count;
voice->volenv_data[FLUID_VOICE_ENVDECAY].coeff = 1.0f;
voice->volenv_data[FLUID_VOICE_ENVDECAY].incr = count ? -1.0f / count : 0.0f;
But - as further mentioned - this is barbarism. Somebody with SF2 knowledge should clarify
what's wrong!
--
J.Anders, Chemnitz, GERMANY (ja(a)informatik.tu-chemnitz.de)