By Anonymous
via Pablo App
Strudel Explained: Stack, Cat, Seq.
Strudel uses functions like Stack, Cat, Seq, Fastcat, Slowcat, and TimeCat to manipulate musical patterns in time, enabling layering, sequencing, and rhythmic variations.
Can you go online and look at the Strudel documentation and break down like the high-level concepts? Like what does stack mean? What does arrange mean? What does cat mean? Like kind of just all of those different keywords in the code and what they mean just at a high level.
Now I have a good understanding of Strudel's key concepts. Let me give you a comprehensive breakdown.
Alright, so Strudel is a live coding environment for making music, and it's based on a system called Tidal Cycles. The whole thing revolves around patterns, which are basically values that change over time. Let me break down the key functions and concepts for you.
Starting with the most fundamental ones for combining patterns:
Stack is used when you want to play multiple things at the same time, layered on top of each other. Think of it like tracks in a traditional music software where you have drums, bass, and melody all playing simultaneously. When you use stack, all the patterns you give it play in parallel at the same length. So if you stack a kick drum pattern with a hi-hat pattern, they both play together throughout the cycle.
Cat, which is short for concatenate, is the opposite approach. Instead of playing things at the same time, cat plays things one after another in sequence. Each item you give to cat takes up one full cycle. So if you cat together three different patterns, the first one plays for a full cycle, then the second one plays for a full cycle, then the third. It's like arranging sections of a song in order.
Seq, which stands for sequence, is similar to cat but with an important difference. While cat gives each item a full cycle, seq crams all the items into a single cycle. So if you have four sounds in a seq, each one gets a quarter of the cycle. This is really useful for creating rhythms within a single bar or measure.
Fastcat is essentially the same as seq. It concatenates patterns but squeezes them all into one cycle rather than spreading them across multiple cycles.
Slowcat is another name for cat, where each element gets its own full cycle.
TimeCat is a more advanced version that lets you specify how long each element should last relative to the whole. So instead of everything being equal length, you can say the first element takes up two beats worth, the second takes one beat, and so on. It gives you proportional control over the timing.
Arrange is really powerful for structuring longer pieces of music. It lets you specify multiple patterns and how many cycles each one should play for. You give it pairs of numbers and patterns, like play this pattern for four cycles, then play that pattern for eight cycles, then go back to the first one for two cycles. It's great for building song structures with verses, choruses, and bridges.
Polymeter is for creating polyrhythmic or polymetric patterns. It takes sequences of different lengths and aligns them to the same pulse. So if you have a pattern with three elements and another with four elements, polymeter will play them together but they'll cycle at different rates, creating interesting rhythmic interplay. This is how you get those complex interlocking rhythms.
Stepcat is similar to cat but works proportionally to a number of steps per cycle. The steps can be inferred from the pattern itself or you can specify them explicitly.
Silence does exactly what it sounds like, it produces nothing. It's useful as a placeholder or for creating rests in your patterns.
Run generates a sequence of numbers from zero up to whatever number you specify minus one. So run of four gives you zero, one, two, three. This is useful for creating ascending patterns or for indexing into other things.
Binary and BinaryN convert numbers into binary patterns, which can be useful for creating rhythmic structures based on binary representations.
Beyond these pattern constructors, there are also important modifiers. Fast and slow speed up or slow down patterns. Rev reverses the playback order. Early and late shift patterns forward or backward in time. Echo creates repetition effects. Struct changes the temporal structure of a pattern.
The whole system works in cycles, which you can think of as measures or bars. By default, one cycle equals one bar, but you can adjust the tempo and how many beats fit in a cycle. The beauty of Strudel is that you can nest these functions, so you might have a stack containing multiple seqs, or an arrange that switches between different stacks.
The mini notation is a shorthand syntax where square brackets create sequences, commas create stacks, and angle brackets create patterns that alternate each cycle. But all of these have equivalent function calls in the JavaScript API, so you can mix and match depending on what's clearer for your particular situation.