Truncate pattern after x cycles

Hi, I'm writing a cover for New Millenium Cyanide Christ (see code below). It's a 23/16 vs 4/4 polymeter, truncated after 8 bars of 4/4. Does anyone know how to restart the pattern after 8 cycles? (curious to see the equivalent in Tidal, if you happen to know!)

// MIDI mappings for my drum VST plugins
let
  bd = note("c2"),
  ch = note("a5"),
  sn = note("cs2"),
  c1 = note("f5"),
  c2 = note("g5"),
  hh = note("cs3"),
  bass = 1,
  synth = 3,
  drums = 2

setcpm(148/4)

let
  r = "1 1 1 1@@ 1@       1@ 1 1  1 1@@  1@ 1@  1 1 1",
  riff = r.pace(16) // @TODO truncate after 16 bars 

$chorus: stack(
  riff.note("bf1").midichan(bass),
  riff.note("bf2").midichan(synth),
  stack(
    bd.struct(riff),
  ).midichan(drums),
  stack(
    c1.struct("1*4"),
    c2.struct("<1 ~ ~ ~ 1 ~ ~ 1>"),
    sn.struct("~ x"),
  ).midichan(drums)
).midi()

Hey it's just a matter of adding .restart("t/8") in strudel, and prefixing "restart "t/8" in tidal. I think you'd need to be running the development version of tidal for the latter to work though.

1 Like

Works!!! Thanks so much Alex for your wisdom as usual. I'll share the video soon!

1 Like