(Initial sound taken from the cover of Thor Magnusson’s book, Scoring Sound)
I have seen this somewhere but I can’t seem to find it. I’m looking for the proper way to have arrays of signals inside a synthdef, and pass the initial array.fill a size argument, then use the index as an argument in that function.
I’m sure there’s something obvious, I just can’t figure out how to search for this issue, everything I search for is about using arrays as arguments in SynthDefs
// Get ERROR: Message '*' not understood, or ERROR: binary operator '*' failed., if I change things around like this:
(
SynthDef(\drone, {
arg freq = 30, out = 0, size = 24;
var freqosc, mulosc, sig, sig2, index;
sig = SinOsc.ar(freq * index + freqosc, 0, mulosc);
freqosc = LFNoise2.ar(0.1).range(-2,2);
mulosc = LFNoise2.ar(0.5) * (Line.ar(0,0.1,99.rand)/(index*0.2));
sig2 = {Array.fill(size, {arg index; sig.(freq * index + freqosc, 0, mulosc)})};
Out.ar(out, sig2);
}).add;
)
// when I play this it works:
{Array.fill(24, {|index| SinOsc.ar(30 * index + LFNoise2.ar(0.1).range(-2,2), 0, LFNoise2.ar(0.5) * (Line.ar(0,0.1,99.rand)/(index*0.2)))})}.play
```
Any help appreciated