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 /utils/gen_adldata | |
parent | 0f6e197d1f2243e1fb9415e1ea2209c39b972650 (diff) | |
download | libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.tar.gz libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.tar.bz2 libADLMIDI-c20df9edf6c19a130dd794a9d6c82c93351afbcc.zip |
Replace the second voice formula
Diffstat (limited to 'utils/gen_adldata')
-rw-r--r-- | utils/gen_adldata/file_formats/load_op2.h | 7 | ||||
-rw-r--r-- | utils/gen_adldata/file_formats/load_wopl.h | 10 |
2 files changed, 5 insertions, 12 deletions
diff --git a/utils/gen_adldata/file_formats/load_op2.h b/utils/gen_adldata/file_formats/load_op2.h index feb85ed..86f1377 100644 --- a/utils/gen_adldata/file_formats/load_op2.h +++ b/utils/gen_adldata/file_formats/load_op2.h @@ -128,11 +128,8 @@ static bool LoadDoom(const char *fn, unsigned bank, const char *prefix) else // Double instrument { tmp2.pseudo4op = true; - tmp2.voice2_fine_tune = (((double)ins.finetune - 128.0) * 15.625) / 1000.0; - if(ins.finetune == 129) - tmp2.voice2_fine_tune = 0.000025; - else if(ins.finetune == 127) - tmp2.voice2_fine_tune = -0.000025; + // Simulate behavior of DMX second voice detune + tmp2.voice2_fine_tune = (double)((ins.finetune >> 1) - 64) / 32.0; //printf("/*DOOM FINE TUNE (flags %000X instrument is %d) IS %d -> %lf*/\n", ins.flags, a, ins.finetune, tmp2.fine_tune); size_t resno = InsertIns(tmp[0], tmp[1], tmp2, std::string(1, '\377') + name, name2); SetBank(bank, (unsigned int)gmno, resno); diff --git a/utils/gen_adldata/file_formats/load_wopl.h b/utils/gen_adldata/file_formats/load_wopl.h index cd8765e..d10d58f 100644 --- a/utils/gen_adldata/file_formats/load_wopl.h +++ b/utils/gen_adldata/file_formats/load_wopl.h @@ -176,15 +176,11 @@ static bool LoadWopl(const char *fn, unsigned bank, const char *prefix) tmp[0].diff = false; tmp[1].diff = real4op && !tmp2.pseudo4op; - int8_t fine_tune = (int8_t)data[offset + 37]; + int fine_tune = (int)data[offset + 37]; if(fine_tune != 0) { - if(fine_tune == 1) - tmp2.voice2_fine_tune = 0.000025; - else if(fine_tune == -1) - tmp2.voice2_fine_tune = -0.000025; - else - tmp2.voice2_fine_tune = ((fine_tune * 15.625) / 1000.0); + // Simulate behavior of DMX second voice detune + tmp2.voice2_fine_tune = (double)((fine_tune >> 1) - 64) / 32.0; } uint32_t gmno = is_percussion ? i + 128 : i; |