[chuck-users] benchmarking UGens

Spencer Salazar ssalazar at CS.Princeton.EDU
Thu Mar 12 12:38:04 EDT 2009

On Mar 12, 2009, at 3:26 AM, Atte André Jensen wrote:

> Another thing: Some UGens could prove more expensive in use  
> (Envelope and ADSR seems to fall into this category), which ones  
> should I test, and how? For Envelope/ADSR I simply connected them to  
> a SinOsc, and found that the cost of ADSR => SinOsc => dac is more  
> than ADSR => dac + SinOsc => dac.

There is an additional cost to chucking anything into SinOsc -- that  
might be what you are seeing here.  SinOsc (and some other Osc's) map  
its input to frequency (depending on the .sync parameter); this entire  
code path is skipped if the tick function detects that there are no  
input ugens.  Perhaps a more fair comparison would be to replace  
SinOsc with a ugen that does not make this optimization, e.g. gain, or  
to do something like:

ADSR env => SinOsc s => dac;
Gain g => s;


Gain g => SinOsc s => dac;
ADSR env => dac;


More information about the chuck-users mailing list