Example from sccode: Why do these two sound different?

Hi there

So I am referencing to this code from sccode:
https://sccode.org/1-5aC

Let’s say I reduce this one to the following:

(
{
    var snd, string, delay;
    string = { |freq|
        var delay;
        delay = freq.reciprocal;
        Pluck.ar(SinOsc.ar(Line.ar(1000, 50, 0.01)) * Env.perc(0.001, 0.01).ar, Impulse.ar(0), delay, delay, 5, 0.5)
    };
    snd = string.(100) + string.(150) + string.(200);
}.play
)

I rewrote it also the following way:

(
{
	Pluck.ar(SinOsc.ar(Line.ar(1000, 50, 0.01)) * Env.perc(0.001, 0.01).ar, Impulse.ar(0), [100.reciprocal,150.reciprocal,200.reciprocal], [100.reciprocal,150.reciprocal,200.reciprocal], 5, 0.5);
}.play
)

Obviously the two sound different, but I can’t really figure out why.

Thanks for your input.

Maaybe because:

snd = string.(100) + string.(150) + string.(200);

produces a mono signal that distorts because it’s louder then nominal 0 at the output.

while:

[100.reciprocal,150.reciprocal,200.reciprocal]

creates three channels because of channels expansion through array of three values.

I agree with Luka.

The first example mixes the three down to one signal.

The second one omits (or forgot?) the mixing operation.

If you have an array of signals, you can mix them with .sum.

hjh

Ah, ok. Thanks for clarification!