aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJP Cimalando <jpcima@users.noreply.github.com>2019-02-24 18:11:05 +0100
committerJP Cimalando <jpcima@users.noreply.github.com>2019-02-24 18:11:05 +0100
commit61e6e56ee1fbc003f348266f0d60f75d64ea1b69 (patch)
treeb69a5cd6c75ffb0811039fa65622d9e55346aa43
parentc22754c48c43a2620c8a4e0d329fa0f394cc0171 (diff)
downloadlibADLMIDI-61e6e56ee1fbc003f348266f0d60f75d64ea1b69.tar.gz
libADLMIDI-61e6e56ee1fbc003f348266f0d60f75d64ea1b69.tar.bz2
libADLMIDI-61e6e56ee1fbc003f348266f0d60f75d64ea1b69.zip
opal: fix the computation of KSL
-rw-r--r--src/chips/opal/opal.hpp9
1 files changed, 3 insertions, 6 deletions
diff --git a/src/chips/opal/opal.hpp b/src/chips/opal/opal.hpp
index f554920..c383bd5 100644
--- a/src/chips/opal/opal.hpp
+++ b/src/chips/opal/opal.hpp
@@ -1237,12 +1237,9 @@ void Opal::Operator::SetFrequencyMultiplier(uint16_t scale) {
//==================================================================================================
void Opal::Operator::SetKeyScale(uint16_t scale) {
- if (scale > 0)
- KeyScaleShift = 3 - scale;
-
- // No scaling, ensure it has no effect
- else
- KeyScaleShift = 15;
+ /* libADLMIDI: KSL computation fix */
+ const unsigned KeyScaleShiftTable[4] = {8, 1, 2, 0};
+ KeyScaleShift = KeyScaleShiftTable[scale];
ComputeKeyScaleLevel();
}