Patterning the @ and ! operators

Hi! I'm trying to understand the behavior of the @ and ! operators inside "{}%" , as they receive patterns. Seems super weird that they parse, but change the value of the lhs operand, instead of just its duration.

For example:

n "{3@<1 2>}%4"
-- returns:
   (0>½)|n: 3.0f
   (½>¾)|n: 1.0f
(¾>1)-1¼|n: 3.0f

and

n "{0![1]}%4"
-- returns:
(0>¼)|n: 0.0f
(¼>½)|n: 0.0f
(½>¾)|n: 1.0f
(¾>1)|n: 0.0f

Can anyone shed a light on what's happening here? Am I missing something?
Thanks!

2 Likes

Patterning doesn't work with @ and !. Your first example is being interpreted as

n "{3@ <1 2>}%4"

where the @ is getting a default argument of two, so it's the same as

n "{3@2 <1 2>}%4"
2 Likes