[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [sc-users] array dynamically in synthdef
- To: sc-users@xxxxxxxxxxxxxxxx
- Subject: Re: [sc-users] array dynamically in synthdef
- From: Guilherme Lunhani <gcravista@xxxxxxxxx>
- Date: Mon, 27 Jul 2009 12:39:58 -0700
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :from:date:message-id:subject:to:content-type; bh=mvYh7DiYdyrg6NJcoCZE18kvOSuuNTUjsI1Gf7kKLJE=; b=o5mOZOfFBFxVeJVB3c0iY4WDGWy2Wih+xuFSg7A8Iym6Q2Zz70vfagqxgN1m8CmAD1 hMlp7HZO1nCFpflYckWmZYLxLwgMHM2z50xk5dhVvFbkXwSGjIxvWFzDKd5N7b/gG4zT P2oVWgwynzB6io+5LeOsYE/keYeDgGmRwZ2b8=
- Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :content-type; b=lYTNfBj7fkptOioJMR6OGXCJq9Avws7bbuFSAFoCK350xakxjLM9Z956letgX8+W7K vC7aLC7bb+W1sBL0TtzsRVQ7lya7xwynbPc3rRHE9xwBdiH+zqqo2PK2ei0L1IsPQdzr FS1FkoA9SLz36AkvztC6FWN4UuwAIWxxNmJxA=
- In-reply-to: <85BBE97E-1818-4C3D-BB31-E11509E4B913@xxxxxxxxx>
- List-id: SuperCollider users mailing list <sc-users.create.ucsb.edu>
- References: <85BBE97E-1818-4C3D-BB31-E11509E4B913@xxxxxxxxx>
- Reply-to: sc-users@xxxxxxxxxxxxxxxx
- Sender: owner-sc-users@xxxxxxxxxxxxxxxx
One solution (I think)
that you would make a big array (like 20 elements)
and when you desire a spectra with 12 partials, the 13th element and
others may have value zero:
(
SynthDef('help-dynKlank', {|
freqs (#[100, 200, 300, 400, 0, 0, 0, 0, 0, 0, 0, ...]),
amps (#[1, 0.3, 0.2, 0.05, 0, 0, 0, 0, 0, 0, ...]),
rings (#[1, 1, 1, 2, 0, 0, 0, 0, 0, 0,...])|
Out.ar(0, DynKlank.ar(`[freqs, amps, rings], WhiteNoise.ar * 0.001))
}).send(s)
)
or make a function (not a SynthDef)
Página pessoal:
http://gcravista.googlepages.com/guilhermemartinslunhanii
On Mon, Jul 27, 2009 at 12:27 PM, Perdo
<pelectron69@xxxxxxxxx> wrote:
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