New tools for long-form compositions: setLoop() and cyclecounter() #1139
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
setLoop(start, length)
alters the core behaviour of Cyclist (like setCps does): playback is always started at the cycle number 'start' (default=0). When a 'length' number of cycles have elapsed, the cycles counter is reset to 'start'. The parameters are floored (decimal part of the number is ignored). When 'length' is zero (default) the playback is not looped.
Evaluating setLoop() without parameters restores the original behaviour.
cyclecounter()
this widget displays the integer part of 'time' value (that is, the current cycle number) in the bottom-right part of the screen. Optional parameters allow the customization of font and color. The 'div' option divides the counter value by a constant. For example: when all measures are 4/4 and 1beat=1cycle, it can be useful to count the measure number by passing {div: 4}
The actual implementation is not very precise at the edges and the visual feedback is janky (I'm hoping for your help in this regard), but it's still very useful for fast-iterating a middle part of a long composition, without altering the overall structure every time.
Example, this plays C D E in loop:
Ode to Joy, but only the 3rd and 4th measure (the counter displays Cycles/4):
Let me know what do you think ... thank you as always!