Browse Source

UI: Clear + Record -> clears whole sequence

Clear + pot wiggle -> clear that pot automation only
Hold Record: Record motion sequencing
dev_cleartrackcc
heck 7 months ago
parent
commit
a6f6c0c231
  1. 17
      src/main_perkons.cc

17
src/main_perkons.cc

@ -164,12 +164,13 @@ namespace Heck {
}
} break;
case ld::MidiMessageType::ControlChange: {
ld::ControlChangeEvent cc = msg.AsControlChange();
if (State::clear_mode) {
ld::ControlChangeEvent cc = msg.AsControlChange();
hw.PrintLine("Clear: ch: %i, cc: %i",cc.channel,cc.control_number);
sequencer.clear_track_cc(cc.channel, cc.control_number);
} else {
sequencer.midi_in(msg);
ld::ControlChangeEvent cc = msg.AsControlChange();
float val_normalized = cc.value / 127.;
switch (cc.control_number) {
// Pots
@ -293,10 +294,16 @@ namespace Heck {
but_rec.Debounce();
but_record_new = but_rec.Pressed();
if (but_record_current != but_record_new) {
// State changed
but_record_current = but_record_new;
if (but_record_current) {
hw.PrintLine("BUTTON RECORD ON");
State::record_mode = true;
if (State::clear_mode) {
hw.PrintLine("CLEAR SEQUENCE");
sequencer.clear_sequence();
} else {
hw.PrintLine("BUTTON RECORD ON");
State::record_mode = true;
}
} else {
hw.PrintLine("BUTTON RECORD OFF");
State::record_mode = false;
@ -308,6 +315,7 @@ namespace Heck {
but_clear.Debounce();
but_clear_new = but_clear.Pressed();
if (but_clear_current != but_clear_new) {
// State changed
but_clear_current = but_clear_new;
if (but_clear_current) {
hw.PrintLine("BUTTON CLEAR ON");
@ -318,9 +326,6 @@ namespace Heck {
}
}
if (State::record_mode && State::clear_mode) {
sequencer.clear_sequence();
}
if (systick_now - midi_log_systick_last > 5) {
midi_log_systick_last = systick_now;

Loading…
Cancel
Save