From 3226999246af7afc6d3d9e988b5cedd947a4fe80 Mon Sep 17 00:00:00 2001 From: Jasmine Iwanek Date: Sun, 5 Jan 2025 14:47:39 -0500 Subject: [PATCH] Fix wrong sample rate of ES1370 software synth playback Fixes low pitch problems when MIDI is played back through the software synth. Co-Authored-By: Cacodemon345 <38420290+Cacodemon345@users.noreply.github.com> --- src/sound/snd_audiopci.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/sound/snd_audiopci.c b/src/sound/snd_audiopci.c index ec3501f81..62a8e0056 100644 --- a/src/sound/snd_audiopci.c +++ b/src/sound/snd_audiopci.c @@ -423,9 +423,9 @@ es1370_calc_sample_rate(es137x_t *dev) dev->calc_sample_rate = 5512; } - dev->calc_sample_rate_synth = 44100 / (1 << ((dev->int_ctrl >> 12) & 3)); - dev->interp_factor_synth = 1. / (double) (1 << ((dev->int_ctrl >> 12) & 3)); - dev->interp_step_synth = (1 << ((dev->int_ctrl >> 12) & 3)); + dev->calc_sample_rate_synth = 44100 / (1 << (((dev->int_ctrl >> 12) & 3) ^ 3)); + dev->interp_factor_synth = 1. / (double) ((1 << ((dev->int_ctrl >> 12) & 3) ^ 3)); + dev->interp_step_synth = (1 << (((dev->int_ctrl >> 12) & 3) ^ 3)); } static void