This repository was archived by the owner on Jun 19, 2025. It is now read-only.
New tools for long-form compositions: setLoop() and cyclecounter()#1139
Open
eefano wants to merge 5 commits intotidalcycles:mainfrom
Open
New tools for long-form compositions: setLoop() and cyclecounter()#1139eefano wants to merge 5 commits intotidalcycles:mainfrom
eefano wants to merge 5 commits intotidalcycles:mainfrom
Conversation
Adds setLoop(start, length) and cyclecounter() widget.
Collaborator
|
As said earlier in discord, all(x=>x.ribbon(2,3))I still like the idea of having a helper function like The problem rn is that all(x=>x.hpf(1000))
setLoop(2,3) // <-- overwrites line aboveTo fix that, we could implement let allTransforms = [];
const all = function (transform) {
allTransforms.push(transform)
return silence;
};
// later:
if (allTransforms.length) {
for(let i in allTransforms) {
pattern = allTransforms[i](pattern);
}
}That would allow defining let setLoop = (a,b) => all(x=>x.ribbon(a,b))I like the idea of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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!