Anton Baskanov : dmsynth: Offset the loop points by 8 frames.
Module: wine Branch: master Commit: b147a3c4a243434fe10ed528aad1d3e15181fc34 URL: https://gitlab.winehq.org/wine/wine/-/commit/b147a3c4a243434fe10ed528aad1d3e... Author: Anton Baskanov <baskanov(a)gmail.com> Date: Mon Oct 23 15:21:52 2023 +0700 dmsynth: Offset the loop points by 8 frames. Fixes out-of-tune Harmonica from gm.dls. --- dlls/dmsynth/synth.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/dlls/dmsynth/synth.c b/dlls/dmsynth/synth.c index 4fabdcdda87..31adf3df1c1 100644 --- a/dlls/dmsynth/synth.c +++ b/dlls/dmsynth/synth.c @@ -1772,8 +1772,11 @@ static int synth_preset_noteon(fluid_preset_t *fluid_preset, fluid_synth_t *flui else FIXME("Unsupported loop type %lu\n", loop->ulType); - fluid_voice_gen_set(fluid_voice, GEN_STARTLOOPADDROFS, loop->ulStart); - fluid_voice_gen_set(fluid_voice, GEN_ENDLOOPADDROFS, loop->ulStart + loop->ulLength); + /* When copy_data is TRUE, fluid_sample_set_sound_data() adds + * 8-frame padding around the sample data. Offset the loop points + * to compensate for this. */ + fluid_voice_gen_set(fluid_voice, GEN_STARTLOOPADDROFS, 8 + loop->ulStart); + fluid_voice_gen_set(fluid_voice, GEN_ENDLOOPADDROFS, 8 + loop->ulStart + loop->ulLength); } LIST_FOR_EACH_ENTRY(articulation, &instrument->articulations, struct articulation, entry) add_voice_connections(fluid_voice, &articulation->list, articulation->connections);
participants (1)
-
Alexandre Julliard