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
- Code Pool SC2 last edited on 5 April 2004 at 3:07 pm by max2-037.dialin.uni-hamburg.de
- enter. last edited on 29 January 2003 at 10:46 pm by 203.14.169.19
- Panning Library last edited on 7 June 2005 at 12:45 pm by iem.kug.ac.at