(
{
    var baseFreq = 100;
    var numHarmonics = 10;
    var amps = Array.fill(numHarmonics, { |i| 1 / (i + 1) }); // amplitude falloff
    var freqs = Array.fill(numHarmonics, { |i|
        baseFreq * (i + 1) * (1 + 0.1 * SinOsc.kr(0.1 * (i + 1)))
    }); // slight modulation of harmonic frequencies

    var sines = Mix.fill(numHarmonics, { |i|
        SinOsc.ar(freqs[i], 0, amps[i])
    });

    sines * 0.2
}.play;
)



// Additive synthesis with arbitrary frequencies
{ Mix.ar([400, 450, 503].collect { |freq| LFTri.ar(freq, 0, 0.1) }).dup }.play;


// Fourier-style additive synthesis: harmonic series
(
{
    var f0 = 100;
    var harmonics = Array.fill(10, { |i|
        SinOsc.ar(f0 * (i + 1), 0, 0.1 / (i + 1))
    });
    Mix(harmonics)
}.play;
)
