Syntax question for staggering note modification over cycles

elloo, I am mucking about, I am trying this pattern:

d1 $ n (off "<0.25 0.125>" (|+ 7) "<c a f e>")
  # sound "supermandolin"

if I wanted the off "<0.25 0.125>" part to only happen every nth cycle, how could I do that? I tried putting an every in there, like this
d1 $ n (every 3 (off "<0.25 0.125>") (|+ 7) "<c a f e>")
but that doesnt work, im sure theres probably a totally different way to approach it im not sure

Is there a reason you are using (|+ 7) in the middle without a parameter?

Perhaps you wanted to do this?

every 3 (off "<0.25 0.125>" (|+ n 7)) $ n "c a f e" # sound "supermandolin"

or maybe like this to be inline with the way you are using brackets instead of a simple $

every 3 (off "<0.25 0.125>" (|+ n 7)) (n "c a f e" # s "supermandolin")

thank you that looks great! I am super new to tidal so this is really helpful, I didnt know I could combine them like that. So putting all that second part in brackets is the same as using $?

I was building from an example I found, so I had no specific goal except I was curious about how control how often some logic can be applied and in what ways. When you say (|+7) is without a parameter, what do you mean? do you mean it needs to have something to the left inside the brackets?

No worries at all. We are all new here all the time. TidalCycles just keeps on evolving through the hard work of many.

Yes, the $ sign is basically a shortcut to enclose the code following inside brackets. It comes from TidalCycles' foundations in Haskell. You can use the operators, `+, -` etc to combine values from two different patterns with or without affecting their structure based on where you put the `|`

Read more about it here Pattern Structure | Tidal Cycles

If you don't give a control name for a pattern like n, or sound or speed, it assumes that you meant n. Just in case you wanted to mess up your pattern in interesting was you can try

d1 
   $ off ("<0 1 2 3>" |* (1/32)") 
   $ note "cafe" # s "supermandolin"```