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

@ -30,6 +30,8 @@ bool StateManager::initialize(AppState& app) {
ch.setSwing(saved_ch_state.base_shuffle);
ch.setCvSource(static_cast<CvSource>(saved_ch_state.cv_source));
ch.setCvDestination(static_cast<CvDestination>(saved_ch_state.cv_destination));
ch.setSteps(saved_ch_state.euc_steps);
ch.setHits(saved_ch_state.euc_hits);
}
return true;
@ -109,6 +111,8 @@ void StateManager::_saveState(const AppState& app) {
save_ch.base_shuffle = ch.getSwing();
save_ch.cv_source = static_cast<byte>(ch.getCvSource());
save_ch.cv_destination = static_cast<byte>(ch.getCvDestination());
save_ch.euc_steps = ch.getSteps();
save_ch.euc_hits = ch.getHits();
}
EEPROM.put(sizeof(Metadata), save_data);
}