Skip to content

Commit

Permalink
Update test and CC terminology
Browse files Browse the repository at this point in the history
  • Loading branch information
rhargreaves committed Aug 3, 2024
1 parent c5fc79c commit fbd15eb
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 39 deletions.
30 changes: 15 additions & 15 deletions src/midi.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
24 changes: 12 additions & 12 deletions src/midi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 6 additions & 6 deletions tests/unit/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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),
Expand Down Expand Up @@ -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),
Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_midi_fm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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++) {
Expand All @@ -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;

Expand All @@ -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;

Expand Down
6 changes: 3 additions & 3 deletions tests/unit/test_synth.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit fbd15eb

Please sign in to comment.