I have several questions.
- Is there an equal power version of XOut readily available?
If there isnt, then id like to ask the following questions. - How are the 2 channel equalpower ugens in supercollider implemented? Is it just by taking the quare root of the linear scaling factors? When i try something like that neither channels fully dip to 0.
(
//my implementation
{
var t = SinOsc.ar(0.1);
var sig1, sig2, cf1, cf2;
cf1 = 1/2 * (1 + t);
cf1 = cf1.sqrt;
cf2 = 1/2 * (1 - t);
cf2 = cf2.sqrt;
sig1 = SinOsc.ar(100);
sig2 = SinOsc.ar(366);
(sig1 * cf1) + (sig2 * cf2) * 0.5;
}.play
)
//compare it to the XFade2 ugen
(
{
var t = SinOsc.ar(0.1)
var sig1, sig2;
sig1 = SinOsc.ar(100);
sig2 = SinOsc.ar(366);
XFade2.ar(sig1, sig2, t)*0.5;
}.play
)
- How in general can you see how Ugens are implemented? When i check the source code i see something like this. Where should i look?
XFade2 : UGen {
// equal power two channel cross fade
*ar { arg inA, inB = 0.0, pan = 0.0, level = 1.0;
^this.multiNew('audio', inA, inB, pan, level)
}
*kr { arg inA, inB = 0.0, pan = 0.0, level = 1.0;
^this.multiNew('control', inA, inB, pan, level)
}
checkInputs { ^this.checkNInputs(2) }
}