View this PageEdit this PageUploads to this PageHistory of this PageTop of the SwikiRecent ChangesSearch the SwikiHelp Guide

Multichannel Panning Examples



//randomly chosen panning axis (sc2)
(
Synth.scope({
var nch, trig, p, silence;
nch = 8;

trig = Impulse.kr(2); //improvised trigger

p = MouseX.kr(-1,1);
silence = Plug.ar(0);
silence = Array.fill(nch-2, { silence });

TrigXFade.ar({
        var sound, out;
        
        sound = Pan2.ar(SinOsc.ar(300, 0,0.1), p); //results in 2 chsnnnels;
        out = sound ++ silence;
        out = out.scramble;
        }, trig, 0.5, nch)
        
        
});
)





(
//random channel crossfading (sc2)
Synth.scope({
var nch, vols, openOld, fadetime;
nch = 8;
fadetime = 0.5;
openOld = Array.fill(2, { nch.rand }); //init openOld

vols = Array.fill(nch, { Plug.kr(0) });
thisSynth.repeat(0, 2, { var openNew;
                        openNew = Array.fill(2, { nch.rand });
                        openOld.do({ arg i; vols.at(i).line(0, fadetime); });
                        openNew.do({ arg i; vols.at(i).line(1, fadetime); });
                        openOld = openNew;
});
SinOsc.ar(300, 0, 0.1)*vols
});

)

//a brief sketch of multichannel binaural delay panning,
//in case something like this really works...
//(sc3)
(
Synth.scope(#{
var mp, n;
n = 4;
mp = { arg in, ctl, ch1, ch2;
	var delaytimes;
	ctl = 0.001 * ctl;
	delaytimes = Array.fill(n, { 0 });
	delaytimes.put(ch1, ctl + 0.001).put(ch2, 0.001-ctl);
	DelayL.ar(in, 0.002, delaytimes)
};

a = Decay2.ar(Dust.ar(5), 0.003, 0.1, SinOsc.ar(543, 0, 0.02));

mp.value(a, MouseX.kr(\bipolar),  0, 1);

}, numChannels:4);


	





feel free to contribute
back to sc

Links to this Page