Introduce basic Euclidean Rhythm (#9)

Each channel can define a euclidean rhythm by setting a number of steps (up to 16) and a number of hits to evenly distribute within those steps. CV Mod is available, however the cv mod acts as an override instead of a sum mix like the other parameters.

Refactor `applyCvMod()` so it is only called if cv mod is active for that channel. Now the setter methods will update the final output value if cv mod is not active.

Reviewed-on: https://git.pinkduck.xyz/adam/libGravity/pulls/9
Co-authored-by: Adam Wonak <adam.wonak@gmail.com>
Co-committed-by: Adam Wonak <adam.wonak@gmail.com>
This commit is contained in:
2025-06-30 17:23:56 +00:00
committed by adam
parent 6d0a9f9f7f
commit ceb01bf03f
7 changed files with 197 additions and 21 deletions

View File

@ -269,6 +269,14 @@ void DisplayChannelPage() {
subText = "DOWN BEAT";
swingDivisionMark();
break;
case PARAM_CH_EUC_STEPS:
mainText = String(ch.getSteps());
subText = "EUCLID STEPS";
break;
case PARAM_CH_EUC_HITS:
mainText = String(ch.getHits());
subText = "EUCLID HITS";
break;
case PARAM_CH_CV_SRC: {
mainText = F("SRC");
switch (ch.getCvSource()) {
@ -305,6 +313,12 @@ void DisplayChannelPage() {
case CV_DEST_SWING:
subText = F("SWING");
break;
case CV_DEST_EUC_STEPS:
subText = F("EUCLID STEPS");
break;
case CV_DEST_EUC_HITS:
subText = F("EUCLID HITS");
break;
}
break;
}
@ -315,7 +329,8 @@ void DisplayChannelPage() {
// Draw Channel Page menu items
String menu_items[PARAM_CH_LAST] = {
F("MOD"), F("PROBABILITY"), F("DUTY"), F("OFFSET"), F("SWING"), F("CV SOURCE"), F("CV DEST")};
F("MOD"), F("PROBABILITY"), F("DUTY"), F("OFFSET"), F("SWING"), F("EUCLID STEPS"),
F("EUCLID HITS"), F("CV SOURCE"), F("CV DEST")};
drawMenuItems(menu_items, PARAM_CH_LAST);
}