From: Anton Baskanov baskanov@gmail.com
--- dlls/dmsynth/synth.c | 12 ++++++------ dlls/dmsynth/tests/dmsynth.c | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 10c82773675..cdefd0d1e22 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1633,8 +1633,8 @@ static BOOL set_gen_from_connection(fluid_voice_t *fluid_voice, const CONNECTION return FALSE; }
- /* SF2 / FluidSynth use 0.1% as "Sustain Level" unit, DLS2 uses percent, meaning is also reversed */ - if (gen == GEN_MODENVSUSTAIN || gen == GEN_VOLENVSUSTAIN) value = 1000 - conn->lScale * 10 / 65536.; + /* SF2 / FluidSynth "Sustain Level" meaning is reversed */ + if (gen == GEN_MODENVSUSTAIN || gen == GEN_VOLENVSUSTAIN) value = 1000 - conn->lScale / 65536.; /* FIXME: SF2 and FluidSynth use 1200 * log2(f / 8.176) for absolute freqs, * whereas DLS2 uses (1200 * log2(f / 440.) + 6900) * 65536. The values * are very close but not strictly identical and we may need a conversion. @@ -1717,8 +1717,8 @@ static void add_mod_from_connection(fluid_voice_t *fluid_voice, const CONNECTION fluid_mod_set_source2(mod, src2, flags2); fluid_mod_set_dest(mod, gen);
- /* SF2 / FluidSynth use 0.1% as "Sustain Level" unit, DLS2 uses percent, meaning is also reversed */ - if (gen == GEN_MODENVSUSTAIN || gen == GEN_VOLENVSUSTAIN) value = 1000 - conn->lScale * 10 / 65536.; + /* SF2 / FluidSynth "Sustain Level" meaning is reversed */ + if (gen == GEN_MODENVSUSTAIN || gen == GEN_VOLENVSUSTAIN) value = 1000 - conn->lScale / 65536.; /* FIXME: SF2 and FluidSynth use 1200 * log2(f / 8.176) for absolute freqs, * whereas DLS2 uses (1200 * log2(f / 440.) + 6900) * 65536. The values * are very close but not strictly identical and we may need a conversion. @@ -1767,7 +1767,7 @@ static void set_default_voice_connections(fluid_voice_t *fluid_voice) {.usDestination = CONN_DST_EG1_ATTACKTIME, .lScale = ABS_TIME_MS(0)}, {.usDestination = CONN_DST_EG1_HOLDTIME, .lScale = ABS_TIME_MS(0)}, {.usDestination = CONN_DST_EG1_DECAYTIME, .lScale = ABS_TIME_MS(0)}, - {.usDestination = CONN_DST_EG1_SUSTAINLEVEL, .lScale = 100 * 65536}, + {.usDestination = CONN_DST_EG1_SUSTAINLEVEL, .lScale = 1000 * 65536}, {.usDestination = CONN_DST_EG1_RELEASETIME, .lScale = ABS_TIME_MS(0)}, /* FIXME: {.usDestination = CONN_DST_EG1_SHUTDOWNTIME, .lScale = ABS_TIME_MS(15)}, */ {.usSource = CONN_SRC_KEYONVELOCITY, .usDestination = CONN_DST_EG1_ATTACKTIME, .lScale = 0}, @@ -1779,7 +1779,7 @@ static void set_default_voice_connections(fluid_voice_t *fluid_voice) {.usDestination = CONN_DST_EG2_ATTACKTIME, .lScale = ABS_TIME_MS(0)}, {.usDestination = CONN_DST_EG2_HOLDTIME, .lScale = ABS_TIME_MS(0)}, {.usDestination = CONN_DST_EG2_DECAYTIME, .lScale = ABS_TIME_MS(0)}, - {.usDestination = CONN_DST_EG2_SUSTAINLEVEL, .lScale = 100 * 65536}, + {.usDestination = CONN_DST_EG2_SUSTAINLEVEL, .lScale = 1000 * 65536}, {.usDestination = CONN_DST_EG2_RELEASETIME, .lScale = ABS_TIME_MS(0)}, {.usSource = CONN_SRC_KEYONVELOCITY, .usDestination = CONN_DST_EG2_ATTACKTIME, .lScale = 0}, {.usSource = CONN_SRC_KEYNUMBER, .usDestination = CONN_DST_EG2_DECAYTIME, .lScale = 0}, diff --git a/dlls/dmsynth/tests/dmsynth.c b/dlls/dmsynth/tests/dmsynth.c index 94e59c0dfad..51da06b3f06 100644 --- a/dlls/dmsynth/tests/dmsynth.c +++ b/dlls/dmsynth/tests/dmsynth.c @@ -2198,7 +2198,7 @@ static void test_dls(void) envelope.sustain.start_value = -96.; envelope.sustain.end_value = -96.; envelope.release.start_value = -96.; - check_volume_envelope(synth, &download, &default_midi, &envelope, TRUE); + check_volume_envelope(synth, &download, &default_midi, &envelope, FALSE);
/* EG1 decay time */
@@ -2429,7 +2429,7 @@ static void test_dls(void) envelope.sustain.start_value = 600.; envelope.sustain.end_value = 600.; envelope.release.start_value = 600.; - check_pitch_envelope(synth, &download, &default_midi, &envelope, TRUE); + check_pitch_envelope(synth, &download, &default_midi, &envelope, FALSE);
/* EG2 decay time */