Function.play (SC3d5)
felix@crucial and Chandrasekhar were hanging out this weekend and came up with
this cute little hack.
Modify the definition of Function::play to be:
// Synth support
play { arg duration, fadeOut=0.1, id;
if(thisProcess.isRealTime,{
^Synth.play(this, duration, fadeOut, id)
},{
#{ arg def,duration,fadeOut,id;
def.asFunction.play(duration,fadeOut,id)
}.send(def,duration, fadeOut,id)
})
}
Then you can play closed function directly! E.g.,:
#{
SinOsc.ar(300, 0, 0.3)
}.play
C. Ramakrishnan cramakrishnan@acm.org
cruxial:
though the relationship between one specific nrtvm and one specific rtvm will change drastically, so this is only (now) a temporary convience.
Links to this Page
- Public Library 3 last edited on 27 October 2006 at 9:41 pm by host81-159-217-15.range81-159.btcentralplus.com
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Public Library SC2 last edited on 2 March 2005 at 2:20 pm by max2-223.dialin.uni-hamburg.de