[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [sc-users] Accessing an argument in an indexed array



Hi Geoff,

An Env is represented internally with a few pieces of information; the envelope "shape" (the typical 2D representation) is stored as 2 arrays, one of levels (.levels) and one of durations (.times).

Env.perc is a factory method that conveniently produces an Env of a common shape, but the Env itself doesn't have data members for attack and decay, it has arrays of levels and durations like all other Envs.

If you want to adjust these parameters, there are two easy solutions:

1. change the `times` on the existing Envs

```
env[3].times = [newAttackTime, newDecayTime];
```

2. represent your data as attack and decay first, and save the transformation to Env for later

```
attackDecayTimes = Array.fill(6, [1, 1])
attackDecayTimes[3] = [newAttackTime, newDecayTime];
envs = attackDecayTimes.collect { |i, ad| Env.perc(ad[0], ad[1]) })
```

Cheers,
Brian

On Sun, Dec 2, 2018 at 11:13 PM <geoffbaltan@xxxxxxxxx> wrote:
Hi there -

I am making an Array.fill of 9 envelopes:

(
var env;
env = Array.fill(6, {
|i, attack=1, decay=1|
Env.perc(attack, decay);
});
env[3].plot;
);


I would like to adjust the attack and decay on individual envelopes in
the array. Is this possible? What is the correct terminology for that?

_______________________________________________
sc-users mailing list

info (subscription, etc.): http://www.birmingham.ac.uk/facilities/ea-studios/research/supercollider/mailinglist.aspx
archive: https://listarc.bham.ac.uk/marchives/sc-users/
search: https://listarc.bham.ac.uk/lists/sc-users/search/