«scritch scratch (tweet)» by snappizz
on 07 Aug'16 23:03 insc3plugins required
1 2
// turn your volume down! this peaks at 0dBFS! play{Decimator.ar(Select.ar({r=TRand.ar(0,3,b=BlitB3 ar:8)}!2,[Decay.ar(b,0.1**r)*GbmanN.ar/2,Ringz.ar(b,3**r*9)]),5**r*1e3).sin}
reception
Nice! I tried removing the "!2" and it made no sound. Why is that?
{...}!2 is a shorthand for 2.collect{...}. {...} is a function. so you also need to remove the braces around "r=Trand.ar(...)".
Normally, a UGen can take a function as an argument no problem. Try replacing "!2" with ".value". It plays on the left channel, which is what you would expect. Why doesn't it work the same without it?
It has something to do with the assignments of r and b inside the function.
oh yeah you're right. Didn't realize you could do stuff like SinOsc.ar({440}). the assignments are probably involved but I'm having trouble figuring out how...
How does this syntax work? TRand.ar(0,3, b=BlitB3 ar:8)
it's two character-saving tricks. first, you have an assignment doubling as an expression. you can save two chars by merging
b=440;SinOsc.ar(b)
intoSinOsc.ar(b=440)
. don't ever do this in real code!the second is the so-called key binary operator.
a b: c
is equivalent toa.b(c)
. take out the second space and you save a char. you can use it if you're passing exactly 1 argument to the message.