Concatenating polyrhythmic sequences

I'm playing with making polyrhythmic sequences by concatenating smaller rhythmic patterns. For example, if I define cellA and cellB, and I want to make structure as follows:

  cellA = "1!3 ~ 1!6 ~ 1!12 ~ 1!9 ~"
  cellB = "1!3 ~ 1!6 ~ 1!21 ~ 1!12 ~ 1!9"
--structure = 2 x cellA, 1 x cellB, all wrapped to 16th notes
--          = "{1!3 ~ 1!6 ~ 1!12 ~ 1!9 ~ 1!3 ~ 1!6 ~ 1!12 ~ 1!9 ~ 1!3 ~ 1!6 ~ 1!21 ~ 1!12 ~ 1!9}%16"

What's the best way to do that?

I have tried playing around with cat and concat but I haven't found a solution yet.

I’m sorry to say that this is something that Tidal currently isn’t very good at—in fact, solving this problem is the main motivation for a current rewrite of Tidal’s core.

Until that happens, the best method is probably using timeCat? That would require that you manually specify the number of steps that each pattern contains, but then it would allow you to concatenate patterns of different lengths.


Thanks for the reply @mindofmatthew! I think you're right: so far timeCat looks like the best approximation. I'll need to practice my onstage arithmetic :wink:

The other approach I was considering was using Haskell's base concat function to make a string that looks right and then turn this into a pattern. E.g.

let structure = concat (["{"] ++ replicate 2 cellA ++ [cellB] ++ ["}%16"])

How can I convert structure (a [Char]) to a Pattern Bool?

Thanks for the insight! Curious to see how this is gonna get implemented in TC eventually.

You're totally right that concatenating mininotation strings is probably the simplest approach for this. In that case, you'll want to pass your string into parseBP_E (the underlying function that Tidal uses for parsing mininotation).

Also, for @staxl and anyone else who's curious: yaxu's blog post is probably the most recent complete-ish explanation, but you can also find bits of discussion in this thread, plus on the Discord innards channel, etc.