Triggering Short Sequences

I'm wondering how it would be possible to trigger a short sequence every given number of cycles.
For example, if I have a sequence like this -

d1 $ s "sn*2 ~ sn sn?"

and I would like it to play at the set tempo but only every 8 cycles. I'm thinking of it as a 1 bar sequence that is triggering every 8 measures.
How would I go about this? There should be an easy solution but I'm at a loss on this one.
Additionally, would it be possible to play the sequence in a similar manner but conditionally using rarely or sometimes?

Haven't tested this, but how about

d1 $ mask "<1 0!7>" $ s "sn*2 ~ sn sn?"

or maybe something using whenmod and # silence?

1 Like

Yes, that seems to work. And this will not play 50% of the time:

d1 $ mask "<1? 0!7>" $ s "sn*2 ~ sn sn?"

1 Like

Perfect! Thank you so much!

You could also adjust this to happen more often by adding a probability after the ?:

d1 $ mask "<1?0.75 0!7>" $ s "sn*2 ~ sn sn?"

1 Like

Thanks @yaxu !

d1 $ every 8 (# gain 0.8)
$ s "sn*2 ~ sn sn?" # gain 0

1 Like

Nice one, thanks!

you can also attach it to some other part. i think this works just fine.

d1 $ every 8 (superimpose (>| s "sn2 ~ sn sn?"))
$ s "kx