From c20df9edf6c19a130dd794a9d6c82c93351afbcc Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Fri, 21 Aug 2020 14:58:12 +0300 Subject: Replace the second voice formula --- src/adlmidi_cvt.hpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/adlmidi_cvt.hpp') diff --git a/src/adlmidi_cvt.hpp b/src/adlmidi_cvt.hpp index cb16eb0..3b2e07d 100644 --- a/src/adlmidi_cvt.hpp +++ b/src/adlmidi_cvt.hpp @@ -29,15 +29,12 @@ template static void cvt_generic_to_FMIns(adlinsdata2 &ins, const WOPLI &in) { ins.voice2_fine_tune = 0.0; - int8_t voice2_fine_tune = in.second_voice_detune; + int voice2_fine_tune = in.second_voice_detune; + if(voice2_fine_tune != 0) { - if(voice2_fine_tune == 1) - ins.voice2_fine_tune = 0.000025; - else if(voice2_fine_tune == -1) - ins.voice2_fine_tune = -0.000025; - else - ins.voice2_fine_tune = voice2_fine_tune * (15.625 / 1000.0); + // Simulate behavior of DMX second voice detune + ins.voice2_fine_tune = (double)(((voice2_fine_tune + 128) >> 1) - 64) / 32.0; } ins.midi_velocity_offset = in.midi_velocity_offset; -- cgit v1.2.3