Hi In my eagerness to play with GenX I coughed up the following code: Phasor osc => Gen10 g10 => dac; int i; [1., 0.5, 0.3, 0.2] @=> float a[]; 440. => osc.freq; while(true){ for(0 => i; i< a.cap(); i++){ Std.rand2f(-.1,.1) +=> a[i]; if(a[i] < 0 || a[i] > 1) { Math.round(a[i]) => a[i]; } } g10.coefs(a); 50::ms => now; } Fortunately the update is glitch free, unfortunately it seems that coefs() is a fairly expensive function :-( I realize that GenX might be supposed to be used with static coefs, but the above seems like it holds a lot of potential. It there a way to to what I do more efficiently or am I simply not supposed to do this? -- peace, love & harmony Atte http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://atte.dk/compositions
hi Atte, this is cool; pretty nifty way to get some subtle variation in the overtones. yer right, coefs() is a fairly expensive function; it recalculates the entire lookup table. in a future version, i suppose we could make the size of the lookup table user controllable so there would be some control over how expensive this recalculation is (i think the table is 1024 long at the moment), but at the moment i don't see any way for you to do this more efficiently. dan On Jun 26, 2007, at 10:10 AM, Atte André Jensen wrote:
Hi
In my eagerness to play with GenX I coughed up the following code:
Phasor osc => Gen10 g10 => dac; int i; [1., 0.5, 0.3, 0.2] @=> float a[]; 440. => osc.freq; while(true){ for(0 => i; i< a.cap(); i++){ Std.rand2f(-.1,.1) +=> a[i]; if(a[i] < 0 || a[i] > 1) { Math.round(a[i]) => a[i]; } } g10.coefs(a); 50::ms => now; }
Fortunately the update is glitch free, unfortunately it seems that coefs() is a fairly expensive function :-( I realize that GenX might be supposed to be used with static coefs, but the above seems like it holds a lot of potential. It there a way to to what I do more efficiently or am I simply not supposed to do this?
-- peace, love & harmony Atte
http://atte.dk | http://myspace.com/attejensen http://anagrammer.dk | http://atte.dk/compositions
_______________________________________________ chuck-users mailing list chuck-users@lists.cs.princeton.edu https://lists.cs.princeton.edu/mailman/listinfo/chuck-users
participants (2)
-
Atte André Jensen
-
dan trueman