Working with long patterns (rev, append, etc)

Greetings tidal community,

Hi, I started learning tidal recently, and am super impressed and inspired! (Kudos Alex and developers). At the same time, I have lots of questions.

After having read the tutorial etc, I tend to want to start with long pattern literals, i.e. played longer than 1 cycle, and then modify them.

scaleit x y = n ((scale "minor" x) + y)

  let m = "[9 8 7 [6 5 3] 2 1 0 ~]/8"
  d1 $ scaleit (rev m) 0 # s "superpiano" # sustain 8

Now, the rev function reverses the individual cycles, and the documentation explicitly mentions that. Of course, what I was going for was a rising sequence, i.e. “[~ 0 1 2 [3 5 6] 7 8 9]/8”.

An obvious workaround (from the docs, I think) is to shrink the pattern to be one cycle, and then expand it again, though this requires knowing the pattern length (is there a simple function that returns this?):

  let m = "[9 8 7 [6 5 3] 2 1 0 ~]/8"
  d1 $ scaleit (slow 8 (rev (fast 8 m))) 0 # s "superpiano" # sustain 8

(Indeed, this is what the inside/outside functions are for.) But is there a way to avoid this intermediate step?

Something similar happens with cat/append. We get alternation between the short pattern and fragments of the long pattern, instead of alternation between long and short patterns. And I suspect that many functions also work this way.

  let m = "[9 8 7 [6 5 3] 2 1 0 ~]/8"
  let m2 = "[0 0*3 0 ~]"
  d1 $ scaleit (append m m2) 0 # s "superpiano" # sustain 8

Are there natural ways to manipulate long patterns without alternation from cycle to cycle of the originally defined length? Why does it seem like most of the functions operate mainly on a 1-cycle scale?

Should we always just contract/expand when we want to transform on longer scales? Surely we can do this automatically, don’t patterns know their own length?

Does it make sense to build pattern operators (possibly, an alternate set) that operate on the repeating length of the pattern, or is there some fundamental hitch to that?

best regards from Oldenburg,


1 Like

length of the pattern

patterns have no length.

here is my attempt at an explanation:


Thanks, J! Your explanation demonstrates clearly how we can have patterns without lengths.

the idea of “pattern = tape loop” already occurs in

I didn’t know this reference when I wrote the text, but of course I should add it.