[chuck-users] benchmarking UGens

Tom Lieber lieber at princeton.edu
Tue Mar 10 12:47:35 EDT 2009


2009/3/10 Kassen <signal.automatique at gmail.com>:
> I also wonder why Pan2 is more expensive
> than 2 Gains; we could use 2 Gain Ugens (and a function) to emulate it,
> maybe this instead tests a higher cost for forcing the DAC to operate in
> stereo?

As far as I can tell, Gain is implemented almost as a noop UGen:

  // from ugen_xxx.cpp
  if( !type_engine_import_ugen_begin( env, "Gain", "UGen", env->global(),
      NULL, NULL, NULL, NULL ) )
    return FALSE;

Those NULLs are function pointers for a constructor, destructor, tick
(sample generator), and something else I don't know about. There is
probably no Gain-specific code; it only needs behavior that's shared
among all UGens anyway, whereas Pan2 has Pan2-specific behavior.

-- 
Tom Lieber
http://AllTom.com/


More information about the chuck-users mailing list