Add menu options for using cv input as Clock Run/Reset #25

Merged
awonak merged 4 commits from run-reset into main 2025-08-10 00:25:07 +00:00
7 changed files with 91 additions and 5 deletions
Showing only changes of commit 4828ec87e5 - Show all commits

View File

@ -94,15 +94,6 @@ void loop() {
// Check if cv run or reset is active and read cv.
CheckRunReset(gravity.cv1, gravity.cv2);
for (int i = 0; i < Gravity::OUTPUT_COUNT; i++) {
auto& ch = app.channel[i];
// Only apply CV to the channel when the current channel has cv
// mod configured.
if (ch.isCvModActive()) {
ch.applyCvMod(gravity.cv1.Read(), gravity.cv2.Read());
}
}
// Check for dirty state eligible to be saved.
stateManager.update(app);
@ -176,9 +167,11 @@ void CheckRunReset(AnalogInput& cv1, AnalogInput& cv2) {
const int val = (app.cv_run == 1) ? cv1.Read() : cv2.Read();
if (val > AnalogInput::GATE_THRESHOLD && gravity.clock.IsPaused()) {
gravity.clock.Start();
app.refresh_screen = true;
} else if (val < AnalogInput::GATE_THRESHOLD && !gravity.clock.IsPaused()) {
gravity.clock.Stop();
ResetOutputs();
app.refresh_screen = true;
}
}
@ -318,6 +311,7 @@ void editMainParameter(int val) {
}
break;
}
// These changes are applied upon encoder button press.
case PARAM_MAIN_ENCODER_DIR:
updateSelection(app.selected_sub_param, val, 2);
break;

View File

@ -262,8 +262,8 @@ void DisplayMainPage() {
}
break;
case PARAM_MAIN_RUN:
mainText = F("RUN SRC");
switch (app.selected_sub_param) {
mainText = F("RUN");
switch (app.cv_run) {
case 0:
subText = F("NONE");
break;
@ -276,8 +276,8 @@ void DisplayMainPage() {
}
break;
case PARAM_MAIN_RESET:
mainText = F("RST SRC");
switch (app.selected_sub_param) {
mainText = F("RST");
switch (app.cv_reset) {
case 0:
subText = F("NONE");
break;