Hi, this is super nooby. I am sure this is quite simple but I don’t find the syntax online. In the following example I would like that the first iteration (.do) of the Task send the first elements of the freq array to the synth, the second iteration the second element of the freq array and so on.
Also, In this case what would happen if the number of iteration is smaller than the array size ? And if it is bigger ?
Thanks a lot
// Example of an array of freqs
c = [500, 507, 607, 637, 677, 734, 800, 850, 900, 910, 930];
(
Tdef(\glisse).set(\smin, 0.4, \smax, 0.4, \emin, 0.1, \emax, 0.1, \h1, 7, \h2, 2.2, \fratio, 0.27, \fratio2, 0.35);
Tdef(\glisse, { |envir|
var f1, f2, h1, h2, temp, sus, sloped, envwide;
c.size.do {
sloped = exprand(envir.smin, envir.smax);
envwide = exprand(envir.emin, envir.emax);
freq = // ????
h1 = exprand(envir.h1, envir.h2);
h2 = h1 * (envir.fratio2 ** 1.0.rand2);
( instrument: \glisson,
sloped: sloped,
envwide:envwide,
freq: freq,
h1:h1,
h2:h2,
pan: 0.5.rand2,
sustain: sloped + envwide / 0.9,
).play;
(sloped + envwide).wait;
};
}).play;
)