This code returns an error, but it works if I remove "arg" from line 4. What can I do to make n an argument and not get an error?
(
SynthDef("test",
{
arg n=8;
f=Mix.fill(n, {
arg index;
var freq, amp;
freq=440*((7/6)**index);
//freq.postln;
amp=(1-(index / n)) / (n*(n+1) / (2*n));
SinOsc.ar(freq,0,0.2*amp)
});
//f=SinOsc.ar(440,0,0.2);
Out.ar(0,f)
}).add;
)