diff --git a/src/midi.c b/src/midi.c index 7aebf27..62737fc 100644 --- a/src/midi.c +++ b/src/midi.c @@ -789,32 +789,32 @@ static void setFmChanParameter(DeviceChannel* devChan, u8 controller, u8 value) synth_operatorAttackRate( devChan->number, controller - CC_GENMDM_ATTACK_RATE_OP1, RANGE(value, 32)); break; - case CC_GENMDM_FIRST_DECAY_RATE_OP1: - case CC_GENMDM_FIRST_DECAY_RATE_OP2: - case CC_GENMDM_FIRST_DECAY_RATE_OP3: - case CC_GENMDM_FIRST_DECAY_RATE_OP4: + case CC_GENMDM_DECAY_RATE_OP1: + case CC_GENMDM_DECAY_RATE_OP2: + case CC_GENMDM_DECAY_RATE_OP3: + case CC_GENMDM_DECAY_RATE_OP4: if (isIgnoringNonGeneralMidiCCs()) break; synth_operatorDecayRate( - devChan->number, controller - CC_GENMDM_FIRST_DECAY_RATE_OP1, RANGE(value, 32)); + devChan->number, controller - CC_GENMDM_DECAY_RATE_OP1, RANGE(value, 32)); break; - case CC_GENMDM_SECOND_DECAY_RATE_OP1: - case CC_GENMDM_SECOND_DECAY_RATE_OP2: - case CC_GENMDM_SECOND_DECAY_RATE_OP3: - case CC_GENMDM_SECOND_DECAY_RATE_OP4: + case CC_GENMDM_SUSTAIN_RATE_OP1: + case CC_GENMDM_SUSTAIN_RATE_OP2: + case CC_GENMDM_SUSTAIN_RATE_OP3: + case CC_GENMDM_SUSTAIN_RATE_OP4: if (isIgnoringNonGeneralMidiCCs()) break; synth_operatorSustainRate( - devChan->number, controller - CC_GENMDM_SECOND_DECAY_RATE_OP1, RANGE(value, 16)); + devChan->number, controller - CC_GENMDM_SUSTAIN_RATE_OP1, RANGE(value, 16)); break; - case CC_GENMDM_SECOND_AMPLITUDE_OP1: - case CC_GENMDM_SECOND_AMPLITUDE_OP2: - case CC_GENMDM_SECOND_AMPLITUDE_OP3: - case CC_GENMDM_SECOND_AMPLITUDE_OP4: + case CC_GENMDM_SUSTAIN_LEVEL_OP1: + case CC_GENMDM_SUSTAIN_LEVEL_OP2: + case CC_GENMDM_SUSTAIN_LEVEL_OP3: + case CC_GENMDM_SUSTAIN_LEVEL_OP4: if (isIgnoringNonGeneralMidiCCs()) break; synth_operatorSustainLevel( - devChan->number, controller - CC_GENMDM_SECOND_AMPLITUDE_OP1, RANGE(value, 16)); + devChan->number, controller - CC_GENMDM_SUSTAIN_LEVEL_OP1, RANGE(value, 16)); break; case CC_GENMDM_RELEASE_RATE_OP1: case CC_GENMDM_RELEASE_RATE_OP2: diff --git a/src/midi.h b/src/midi.h index 675c827..762e0af 100644 --- a/src/midi.h +++ b/src/midi.h @@ -58,18 +58,18 @@ #define CC_GENMDM_ATTACK_RATE_OP2 44 #define CC_GENMDM_ATTACK_RATE_OP3 45 #define CC_GENMDM_ATTACK_RATE_OP4 46 -#define CC_GENMDM_FIRST_DECAY_RATE_OP1 47 -#define CC_GENMDM_FIRST_DECAY_RATE_OP2 48 -#define CC_GENMDM_FIRST_DECAY_RATE_OP3 49 -#define CC_GENMDM_FIRST_DECAY_RATE_OP4 50 -#define CC_GENMDM_SECOND_DECAY_RATE_OP1 51 -#define CC_GENMDM_SECOND_DECAY_RATE_OP2 52 -#define CC_GENMDM_SECOND_DECAY_RATE_OP3 53 -#define CC_GENMDM_SECOND_DECAY_RATE_OP4 54 -#define CC_GENMDM_SECOND_AMPLITUDE_OP1 55 -#define CC_GENMDM_SECOND_AMPLITUDE_OP2 56 -#define CC_GENMDM_SECOND_AMPLITUDE_OP3 57 -#define CC_GENMDM_SECOND_AMPLITUDE_OP4 58 +#define CC_GENMDM_DECAY_RATE_OP1 47 +#define CC_GENMDM_DECAY_RATE_OP2 48 +#define CC_GENMDM_DECAY_RATE_OP3 49 +#define CC_GENMDM_DECAY_RATE_OP4 50 +#define CC_GENMDM_SUSTAIN_RATE_OP1 51 +#define CC_GENMDM_SUSTAIN_RATE_OP2 52 +#define CC_GENMDM_SUSTAIN_RATE_OP3 53 +#define CC_GENMDM_SUSTAIN_RATE_OP4 54 +#define CC_GENMDM_SUSTAIN_LEVEL_OP1 55 +#define CC_GENMDM_SUSTAIN_LEVEL_OP2 56 +#define CC_GENMDM_SUSTAIN_LEVEL_OP3 57 +#define CC_GENMDM_SUSTAIN_LEVEL_OP4 58 #define CC_GENMDM_RELEASE_RATE_OP1 59 #define CC_GENMDM_RELEASE_RATE_OP2 60 #define CC_GENMDM_RELEASE_RATE_OP3 61 diff --git a/tests/unit/main.c b/tests/unit/main.c index 54c34a0..277030f 100644 --- a/tests/unit/main.c +++ b/tests/unit/main.c @@ -131,9 +131,9 @@ int main(void) midi_test(test_midi_sets_operator_detune), midi_test(test_midi_sets_operator_rate_scaling), midi_test(test_midi_sets_operator_attack_rate), - midi_test(test_midi_sets_operator_first_decay_rate), - midi_test(test_midi_sets_operator_second_decay_rate), - midi_test(test_midi_sets_operator_secondary_amplitude), + midi_test(test_midi_sets_operator_decay_rate), + midi_test(test_midi_sets_operator_sustain_rate), + midi_test(test_midi_sets_operator_sustain_level), midi_test(test_midi_sets_operator_amplitude_modulation), midi_test(test_midi_sets_operator_release_rate), midi_test(test_midi_sets_operator_ssg_eg), @@ -218,11 +218,11 @@ int main(void) synth_test(test_synth_sets_feedback_and_algorithm), synth_test(test_synth_sets_operator_multiple_and_detune), synth_test(test_synth_sets_operator_attack_rate_and_rate_scaling), - synth_test(test_synth_sets_operator_second_decay_rate), + synth_test(test_synth_sets_operator_sustain_rate), synth_test( - test_synth_sets_operator_release_rate_and_secondary_amplitude), + test_synth_sets_operator_release_rate_and_sustain_level), synth_test( - test_synth_sets_operator_amplitude_modulation_and_first_decay_rate), + test_synth_sets_operator_amplitude_modulation_and_decay_rate), synth_test(test_synth_sets_operator_ssg_eg), synth_test(test_synth_sets_global_LFO_enable_and_frequency), synth_test(test_synth_sets_busy_indicators), diff --git a/tests/unit/test_midi_fm.c b/tests/unit/test_midi_fm.c index 8042257..938639d 100644 --- a/tests/unit/test_midi_fm.c +++ b/tests/unit/test_midi_fm.c @@ -275,7 +275,7 @@ static void test_midi_sets_operator_attack_rate(UNUSED void** state) } } -static void test_midi_sets_operator_first_decay_rate(UNUSED void** state) +static void test_midi_sets_operator_decay_rate(UNUSED void** state) { const u8 expectedValue = 2; for (u8 chan = 0; chan < MAX_FM_CHANS; chan++) { @@ -290,7 +290,7 @@ static void test_midi_sets_operator_first_decay_rate(UNUSED void** state) } } -static void test_midi_sets_operator_second_decay_rate(UNUSED void** state) +static void test_midi_sets_operator_sustain_rate(UNUSED void** state) { const u8 expectedValue = 1; @@ -306,7 +306,7 @@ static void test_midi_sets_operator_second_decay_rate(UNUSED void** state) } } -static void test_midi_sets_operator_secondary_amplitude(UNUSED void** state) +static void test_midi_sets_operator_sustain_level(UNUSED void** state) { const u8 expectedValue = 1; diff --git a/tests/unit/test_synth.c b/tests/unit/test_synth.c index 71d8a9a..62523f1 100644 --- a/tests/unit/test_synth.c +++ b/tests/unit/test_synth.c @@ -201,7 +201,7 @@ static void test_synth_sets_operator_attack_rate_and_rate_scaling(UNUSED void** } } -static void test_synth_sets_operator_second_decay_rate(UNUSED void** state) +static void test_synth_sets_operator_sustain_rate(UNUSED void** state) { const u8 baseReg = 0x70; u8 sustainRate = 16; @@ -213,7 +213,7 @@ static void test_synth_sets_operator_second_decay_rate(UNUSED void** state) } } -static void test_synth_sets_operator_release_rate_and_secondary_amplitude(UNUSED void** state) +static void test_synth_sets_operator_release_rate_and_sustain_level(UNUSED void** state) { const u8 baseReg = 0x80; u8 sustainLevel = 15; @@ -228,7 +228,7 @@ static void test_synth_sets_operator_release_rate_and_secondary_amplitude(UNUSED } } -static void test_synth_sets_operator_amplitude_modulation_and_first_decay_rate(UNUSED void** state) +static void test_synth_sets_operator_amplitude_modulation_and_decay_rate(UNUSED void** state) { const u8 baseReg = 0x60; u8 amplitudeModulation = 1;