From e58ba27c003d01a48b68f26aec594022e95df5cc Mon Sep 17 00:00:00 2001 From: Thomas Harte Date: Fri, 17 Apr 2020 22:30:10 -0400 Subject: [PATCH] Clarifies meaning of scaling. Though it isn't yet applied. --- Components/OPL2/Implementation/Operator.cpp | 4 ++-- Components/OPL2/Implementation/Operator.hpp | 8 ++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Components/OPL2/Implementation/Operator.cpp b/Components/OPL2/Implementation/Operator.cpp index f7cd80365..5c275fa58 100644 --- a/Components/OPL2/Implementation/Operator.cpp +++ b/Components/OPL2/Implementation/Operator.cpp @@ -23,7 +23,7 @@ void Operator::set_sustain_release(uint8_t value) { } void Operator::set_scaling_output(uint8_t value) { - scaling_level_ = value >> 6; + level_key_scaling_ = value >> 6; attenuation_ = value & 0x3f; } @@ -35,7 +35,7 @@ void Operator::set_am_vibrato_hold_sustain_ksr_multiple(uint8_t value) { apply_amplitude_modulation_ = value & 0x80; apply_vibrato_ = value & 0x40; use_sustain_level_ = value & 0x20; - keyboard_scaling_rate_ = value & 0x10; + key_scaling_rate_ = value & 0x10; frequency_multiple_ = value & 0xf; } diff --git a/Components/OPL2/Implementation/Operator.hpp b/Components/OPL2/Implementation/Operator.hpp index 25578ebe2..567b738c1 100644 --- a/Components/OPL2/Implementation/Operator.hpp +++ b/Components/OPL2/Implementation/Operator.hpp @@ -102,9 +102,6 @@ class Operator { /// level is hit, getting back to 0 regardless of an ongoing key-on. bool use_sustain_level_ = false; - /// Provides a potential faster step through the ADSR envelope. Cf. p12. - bool keyboard_scaling_rate_ = false; - /// Indexes a lookup table to determine what multiple of the channel's frequency /// this operator is advancing at. int frequency_multiple_ = 0; @@ -112,8 +109,11 @@ class Operator { /// Sets the current output level of this modulator, as an attenuation. int attenuation_ = 0; + /// Provides a potential faster step through the ADSR envelope. Cf. p12. + bool key_scaling_rate_ = false; + /// Selects attenuation that is applied as a function of interval. Cf. p14. - int scaling_level_ = 0; + int level_key_scaling_ = 0; /// Sets the ADSR rates. These all provide the top four bits of a six-bit number; /// the bottom two bits... are 'RL'?