Add per-channel Swing configuration #7

Merged
awonak merged 9 commits from refs/pull/7/head into main 2025-06-22 18:38:51 +00:00
6 changed files with 88 additions and 25 deletions
Showing only changes of commit 05b0989f91 - Show all commits

View File

@ -129,25 +129,30 @@ class Channel {
// Calculate and store cv modded values using bipolar mapping.
// Default to base value if not the current CV destination.
cvmod_clock_mod_index = (cv_destination == CV_DEST_MOD)
? constrain(base_clock_mod_index + map(value, -512, 512, -10, 10), 0, MOD_CHOICE_SIZE - 1)
: base_clock_mod_index;
cvmod_clock_mod_index =
(cv_destination == CV_DEST_MOD)
? constrain(base_clock_mod_index + map(value, -512, 512, -10, 10), 0, MOD_CHOICE_SIZE - 1)
: base_clock_mod_index;
cvmod_probability = (cv_destination == CV_DEST_PROB)
? constrain(base_probability + map(value, -512, 512, -50, 50), 0, 100)
: base_probability;
cvmod_probability =
(cv_destination == CV_DEST_PROB)
? constrain(base_probability + map(value, -512, 512, -50, 50), 0, 100)
: base_probability;
cvmod_duty_cycle = (cv_destination == CV_DEST_DUTY)
? constrain(base_duty_cycle + map(value, -512, 512, -50, 50), 1, 99)
: base_duty_cycle;
cvmod_duty_cycle =
(cv_destination == CV_DEST_DUTY)
? constrain(base_duty_cycle + map(value, -512, 512, -50, 50), 1, 99)
: base_duty_cycle;
cvmod_offset = (cv_destination == CV_DEST_OFFSET)
? constrain(base_offset + map(value, -512, 512, -50, 50), 0, 99)
: base_offset;
cvmod_swing = (cv_destination == CV_DEST_SWING)
? constrain(base_swing + map(value, -512, 512, -25, 25), 50, 95)
: base_swing;
cvmod_offset =
(cv_destination == CV_DEST_OFFSET)
? constrain(base_offset + map(value, -512, 512, -50, 50), 0, 99)
: base_offset;
cvmod_swing =
(cv_destination == CV_DEST_SWING)
? constrain(base_swing + map(value, -512, 512, -25, 25), 50, 95)
: base_swing;
}
private:

View File

@ -161,7 +161,6 @@ void swingDivisionMark() {
gravity.display.drawBox(56, 4, 4, 4);
gravity.display.drawBox(57, 5, 2, 2);
break;
}
}