Fellow ChucKists. 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? Yours, Kas.
2009/7/14 Kassen
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/
Tom;
I don't know which version of ChucK I'm editing, but it fixed it on my computer.
I do; I was editing 1.2.1.2 making the linux-alsa version as a part of the linux-alsa version of the mini (pasted in the canonical mini source). This works fine, making it doesn't seem to give more errors than the usual amount of warnings. All types of noise check in (with brown and fbm being predicatbly silent as those were labeled as "later" in the source). "flip" and "xor" are nearly identical to my ear (on crappy laptop speakers) with "flip" sounding ever so slightly darker and more smooth. "my_CNoise.mode("foo");" doesn't change anything, instead of the more logical option of warning the user that a unkown type of noise was requested. Another odd thing is that the default setting (without any call to .mode() ) seems different from any of the presets, it sounds quite similar to "pink" with a gain of 0.04. Assuming we'd like to keep the "Noise" UGen (which does seem redundant now, aside from compatibility) I'd sugest the default being the "pink" preset. ".mode()" can't be called either, that could be considered inconsistent with the typical way of functions being overloaded for setting and getting. Aside from those notes I can't see any reason why this fix shouldn't go straight into the next version of ChucK as it is, it's a big improvement to me, especially as pink noise is such a great tool for testing systems and for more natural sounding noise sources. In this state it looks completely workable to me, to the point where I almost feel bad about still noting issues. Many thanks for your swift and effective reply; beautiful work. Gratefully yours, Kas.
participants (2)
-
Kassen
-
Tom Lieber