diff options
author | Wohlstand <admin@wohlnet.ru> | 2020-08-21 14:58:12 +0300 |
---|---|---|
committer | Wohlstand <admin@wohlnet.ru> | 2020-08-21 14:58:12 +0300 |
commit | c20df9edf6c19a130dd794a9d6c82c93351afbcc (patch) | |
tree | f72525f3dac1e9cd59d0c5b0909dbc7cd38ff504 /src/adlmidi_cvt.hpp | |
parent | 0f6e197d1f2243e1fb9415e1ea2209c39b972650 (diff) | |
download | libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.tar.gz libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.tar.bz2 libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.zip |
Replace the second voice formula
Diffstat (limited to 'src/adlmidi_cvt.hpp')
-rw-r--r-- | src/adlmidi_cvt.hpp | 11 |
1 files changed, 4 insertions, 7 deletions
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 <class WOPLI> 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; |