Is it possible to "interleave" patterns in Strudel? #1201
-
My first live coding experience was with FoxDot, which approaches things a little differently. Strudel is absolutely fantastically amazing, but one of the things I've been missing and trying to replicate from FoxDot is the way that you can play sounds with arrays for pitch, duration, (and other modifiers), for example:
When executed, FoxDot recursively interleaves the inputs into a longer pattern with every possible combination of pitch and duration; so with the above structure you'd wind up with a sequence like:
The arrays can be different lengths and each array can nest other arrays, which makes it easy to quickly create and tweak fantastically complex melodies rhythms. I know you can pass multiple values to I'm still in the "don't know what I don't know" learning phase with Strudel, so I'm not sure if this is conceptual roadblock on my part (maybe not possible with mini notation, but doable with api functions?), or if Strudel just doesn't work this way. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 3 replies
-
...Still don't know if there's an existing and/or more idiomatic way to do this, but yes, it is possible! I haven't published an official package yet but I wrote some JS functions to deal with the recursive permutation part, and I was able to import that into the REPL and map the results through
|
Beta Was this translation helpful? Give feedback.
-
hey @mystery-house ! doing stuff like this is really a bit difficult with the way patterns work.. these list based sequencing techniques are very easy to implement when you have state (e.g. a pointer to the currently active element). Patterns don't have any state, which is why it's harder to represent something like this. It might still be possible, if you're able to find a pure/stateless function that returns the events for a certain time frame. Of course, precalculating is also an option, and probably sufficient in most cases. On that note, it might be better if you'd not generate a mini notation string, but instead throw your events into timeCat, which allows you to specify events with durations. This way, it might also be possible to get proper highlighting |
Beta Was this translation helpful? Give feedback.
hey @mystery-house ! doing stuff like this is really a bit difficult with the way patterns work.. these list based sequencing techniques are very easy to implement when you have state (e.g. a pointer to the currently active element). Patterns don't have any state, which is why it's harder to represent something like this. It might still be possible, if you're able to find a pure/stateless function that returns the events for a certain time frame. Of course, precalculating is also an option, and probably sufficient in most cases.
On that note, it might be better if you'd not generate a mini notation string, but instead throw your events into timeCat, which allows you to specify events with…