crucialfelix / crucial-library

SuperCollider music programming library.
17 stars 4 forks source link

arg width in XFaderN #15

Open FunctionalJerk opened 1 year ago

FunctionalJerk commented 1 year ago

In the file UncoupledUsefulThings/AudioHelpers.sc the argument width is not used correctly within the PanAz-UGen. Right now it controls the level, not the width. The correct implementation should be:

XFaderN  {

    *ar { arg inputs, bipolar, width=2.0;
        var whiches;
        inputs = inputs.dereference;
        whiches = PanAz.ar(inputs.size, SinOsc.ar(0.0, add:1.0), bipolar, 1, width);

        ^Mix.new(
            inputs.collect({ arg sound, i;
                sound * whiches.at(i)
            })
        )
    }
    *kr { arg inputs, bipolar, width=2.0;
        var whiches;
        inputs = inputs.dereference;
        whiches = PanAz.ar(inputs.size, SinOsc.ar(0.0, add:1.0), bipolar, 1, width);

        ^Mix.new(
            inputs.collect({ arg sound, i;
                sound * whiches.at(i)
            })
        )
    }
}