|
If you want to change an array dynamically in a SynthDef check out Control. There is an example in the help file for Control which uses Klank.ar I think that is basically what you want, right? Hope that helps. gr. Michael From: pelectron69@xxxxxxxxx To: sc-users@xxxxxxxxxxxxxxxx Subject: [sc-users] array dynamically in synthdef Date: Mon, 27 Jul 2009 21:27:40 +0200 Dear list, Excuse me if this question already has been done a lot of times but don't know the answer in the lists archives...
Now I play with this beautiful ugens DynKlank and DynKlang.
It's possible to change dynamically de numbers of arrays elements for controlling these ugens?
From the example:
(
SynthDef('help-dynKlank', {|
freqs (#[100, 200, 300, 400]),
amps (#[1, 0.3, 0.2, 0.05]),
rings (#[1, 1, 1, 2])|
Out.ar(0, DynKlank.ar(`[freqs, amps, rings], WhiteNoise.ar * 0.001))
}).send(s)
)
a.setn(\freqs, Array.rand(4, 500, 2000));
a.setn(\amps, Array.exprand(4, 0.01, 1));
If I change the number (by default 4) of elements to 10 for example nothing change or bang!! (explode), for this doesn't work:
a.setn(\freqs, [100, 101, 102, 103, 300, 1000]);
a.setn(\amps, [0.1, 0.1, 0.1, 0.2, 0.3, 0.4]);
a.setn(\rings, [1, 1, 1, 1, 1, 1]);
I know that I can have a lots of synthdef with different defaults arrays number and play with, but if I use resonances models from fft analyses that changes all time it's not funny...
Is a syntax problem or only not possible?
Any help would be appreciated
Best
p
Deel je favoriete foto's online met Windows Live Photos |