Skip to content

Commit

Permalink
Add reverb browsing, and change button UI LEDs
Browse files Browse the repository at this point in the history
  • Loading branch information
klovjan committed Nov 23, 2021
1 parent f89fd23 commit 5a2ead1
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -192,8 +192,8 @@ void handle_button(uint8_t pin) {
}
else {
// Handle reverb preset browsing (NOTE: abort and perform synth transfer, )
// current_reverb_preset = current_reverb_preset+1 % REVERB_PRESET_LEN;
// synth.reverb = reverb_presets[current_reverb_preset];
current_reverb_preset = (current_reverb_preset+1) % REVERB_PRESET_LEN;
event_flag = true;
}
break;
case BUTTON_SW2:
Expand All @@ -204,11 +204,11 @@ void handle_button(uint8_t pin) {
if (arpeggiator.dynamic_NPB_switching) {
arpeggiator.dynamic_NPB_switching = false;
set_notes_per_beat(&arpeggiator, 4);
GPIO_PinOutClear(LED_PORT, LED2);
GPIO_PinOutClear(LED_PORT, LED1);
}
else {
arpeggiator.dynamic_NPB_switching = true;
GPIO_PinOutSet(LED_PORT, LED2);
GPIO_PinOutSet(LED_PORT, LED1);
set_notes_per_beat(&arpeggiator, arpeggiator.num_held_keys);
}
}
Expand All @@ -235,11 +235,11 @@ void handle_button(uint8_t pin) {
/* Toggle arpeggiator */
if (!arpeggiator_on) {
arpeggiator_on = true;
GPIO_PinOutSet(LED_PORT, LED1);
GPIO_PinOutSet(LED_PORT, LED2);
}
else {
arpeggiator_on = false;
GPIO_PinOutClear(LED_PORT, LED1);
GPIO_PinOutClear(LED_PORT, LED2);
GPIO_PinOutClear(LED_PORT, LED3);
}
break;
Expand Down Expand Up @@ -321,6 +321,7 @@ int main(void) {
event_flag = false;
abort_synth_transfer();

synth.reverb = reverb_presets[current_reverb_preset];
update_arpeggiator();
recv_midi_command();

Expand Down

0 comments on commit 5a2ead1

Please sign in to comment.