[chuck-users] CNoise

Tom Lieber tom at alltom.com
Tue Jul 14 17:33:12 EDT 2009


2009/7/14 Kassen <signal.automatique at gmail.com>:
> CNoise is under-documented, the only official reference to it seems to be
> that "cnoise" is depreciated, with "CNoise" being prefered since 1.2.0.7.
> Still it's there in the source and can be used without errors. However, it
> doesn't seem to work like I expect it to. Based on the source I'd say
> correct usage should be something like this;
>
> CNoise n => dac;
>
> "white" => n.mode;
> second => now;
> "pink" => n.mode;
> second => now;
> "flip" => n.mode;
> second => now;
> "xor" => n.mode;
> second => now;
> "brown" => n.mode;
> second => now;
> "fbm" => n.mode;
> second => now;
>
> This does indeed compile but all I get is one type of noise only. Could
> somebody kindly help or explain?

There was a bug in CNoise. Replace this

  const char * mode= (const char *)*(char **)GET_CK_STRING(ARGS);

with this:

  const char * mode= GET_NEXT_STRING(ARGS)->str.c_str();

I don't know which version of ChucK I'm editing, but it fixed it on my computer.

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


More information about the chuck-users mailing list