home/ atoms/ tidal-pattern-as-function

A Tidal pattern is a function from a time arc to a list of events, not a stored sequence

Tidal’s core representation is that a Pattern is a function from a time arc (a begin/end span) to the list of events (Haps) that fall in it; events are generated on demand by querying, not pre-computed and stored. This has several consequences. Patterns are notionally infinite: any future span queries the same, at no storage cost proportional to duration. It gives random access — you can query the 100th cycle directly without computing the first 99, so when a live coder redefines a pattern the new function applies from the current time onward without replaying history. Transformations compose by wrapping and transforming the query function, not by processing lists, which is why fast, slow, every, and jux are all built as query wrappers. Using arcs (start,end) rather than single time points lets one type cover both discrete and continuous patterns. And because a pattern is any function of time, a pattern and the transformation applied to it are the same kind of object: you can pattern the amount of a transformation (reverb, speed, transposition) just as you pattern the notes — ‘patterns all the way down’ — giving huge combinatorial power from few primitives.

Examples

The pattern for "bd*4" queried over arc (0,1) returns 4 events at 0, 0.25, 0.5, 0.75; queried over (100,101) it returns the same, with no stored cycles 0–100. In Strudel: sequence('a', ['b','c']).queryArc(0, 1) returns all Haps overlapping cycle 0–1, and re-querying the same span always yields the same Haps. ‘Patterns all the way down’: note("c e g").sometimes(rev) (the transform is itself patternable) or n("0 1 2 3").speed("1 1.5 0.75 2") (pitch index and playback speed are patterns at the same level).

Assessment

Explain why representing patterns as functions rather than stored event lists enables infinite-length patterns and random access, and how that solves the mid-performance substitution problem that lazy-list systems have. Explain why ‘patterns all the way down’ means you can pattern the amount of a transformation; give an example where a transform parameter is itself sequenced cycle to cycle. State what pattern.queryArc(0.5, 1.5) returns and why re-querying the same span is deterministic.

“aPatternis represented as a function, from anArcto a list of events. To retrieve events from the pattern, it is queried”
corpus · l3-l4-making-programming-languages-to-dance-to-live-coding-w · chunk 3
“Tidal allows for random access by representing a paern not as a list of events but as a function fr”
corpus · l4-l5-artist-programmers-and-programming-languages-for-the-a · chunk 25
“functional relationship between time and events. A pattern may therefore be transformed in terms of”
corpus · l4-l5-performing-with-patterns-of-time-magnusson-and-mclean · chunk 5
“Query haps inside the given time span.”
corpus · strudel-internals-pattern-as-function-of-time-functor-applic · chunk 1
“because everything's a pattern there's patterns all the way down so there's like a pattern for the notes but then you can have on the same level the same level of complexity a pattern on reverb for example or Distortion”
corpus · why-we-bleep-045-algorave-alex-mclean-podcast · chunk 5