View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

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