Add per-channel Swing configuration (#7)

Select swing amount from a percentage range of the beat starting a 50% (unchanged) to a max swing amount of 95% (about 1/32nd note before end of period). Swing percentage shows an indicator marker when the percentage lines up with a quantized note on the grid.

This is probably going to be the last feature because it is pushing up against the limits of available dynamic memory.

Out of scope changes:
- selecting parameters / values no longer wraps
- reduce dynamic memory used in processClockTick
- various readability formatting

Reviewed-on: https://git.pinkduck.xyz/adam/libGravity/pulls/7
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-22 18:38:51 +00:00
committed by adam
parent c8e42c7448
commit 973c13b8ef
6 changed files with 95 additions and 32 deletions

View File

@ -27,6 +27,7 @@ bool StateManager::initialize(AppState& app) {
ch.setProbability(saved_ch_state.base_probability);
ch.setDutyCycle(saved_ch_state.base_duty_cycle);
ch.setOffset(saved_ch_state.base_offset);
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));
}
@ -105,6 +106,7 @@ void StateManager::_saveState(const AppState& app) {
save_ch.base_probability = ch.getProbability(false);
save_ch.base_duty_cycle = ch.getDutyCycle(false);
save_ch.base_offset = ch.getOffset(false);
save_ch.base_shuffle = ch.getSwing();
save_ch.cv_source = static_cast<byte>(ch.getCvSource());
save_ch.cv_destination = static_cast<byte>(ch.getCvDestination());
}