First we have to make sure we know RPN! So working our way from right to left: “% T 12” is “T modulo 12”. In my world I always use T as time-keeper, incremented on each metro tick, so on first tick it’s 0, next 1, next 2 etc until teletype overflows. So in my world this would translate into something that repeats every 12 steps, like 12 16th notes in a bar, and the result is the position in the bar from 0-11.
P is lookup in current pattern, so we’re getting values out of the pattern from location 0 on first step, location 1 on second step etc, wrapping around so on 13th step we’re getting from location 0 again.
The retrieved value is finally stored in the local variable K. So after this line K holds the value retrieved from current pattern on the location corresponding with where we are in the bar.
First we have to know that ? is the ternary operator, so “? a b c” is “if a then b otherwise c”. In this line a is “P Y”, b=1 and c=0. “P Y” is (again) pattern lookup, returning the value stored in current patten on location Y. In my world (since you might have gotten this from me) is always current location in the bar (since I use it so much, I don’t want to waste space on calculating it all over the place, so I calculates it once after T is updated), in standard 4/4 time I’d have “Y % T 16” somewhere. In any case the “? P Y 1 0” returns 1 if location Y in current pattern is non-zero, and zero if otherwise. This value is then stored in the global variable A.
Hope that helps…