do you have a good way to deal with additive synthesis in a universal way until we have the sine bank ;)?
imagine for example i want to have only the fundamental Ab2
and the 7th partial F#5
(-31 dev. from 12TET) of the harmonic series with specific amplitudes for example sig = SinOsc.ar([103.826, 726.783 * 2], 0, [0.5, 0.6]).sum;
and another time more partials with a specific amplitude conture for example all even partials up to a specific overtone. i would like to control everything with patterns and not write a new SynthDef every single time for only one specific case. any ideas ?
(
(1..50).do({|partials|
SynthDef(\additive ++ partials, {
var sig, freqs, gainEnv;
gainEnv = EnvGen.ar(Env.adsr(
\atk.kr(0.07),
\dec.kr(0.5),
\sus.kr(1),
\rel.kr(2),
curve: \curve.kr(-4)
), \gate.kr(1), doneAction:2);
freqs = Array.fill(partials, {|i|
\freq.kr(20) * (i+1); // even partials
});
sig = freqs.collect({|freq, i|
var amps = \decay.kr(0.5) / (i+1); // even partials
SinOsc.ar(freq) * amps;
});
sig = Mix(sig);
sig = sig * gainEnv * \amp.kr(0.3) * \vel.kr(1);
sig = Splay.ar(sig);
Out.ar(\out.kr(0), sig)
}).add;
});
)
x = Synth(\additive10, [\freq, 110, \decay, 0.5]);
x.set(\gate, 0);