2 summary:: Spreads an array of channels across a ring of channels
3 categories:: UGens>Multichannel>Panners
4 related:: Classes/Splay, Classes/SplayZ
7 SplayAz spreads an array of channels across a ring of channels.
8 Optional spread and center controls, and levelComp(ensation) (equal power).
9 numChans and orientation are as in link::Classes/PanAz::.
20 argument:: orientation
31 argument:: orientation
37 x = { arg spread=1, level=0.2, width=2, center=0.0;
40 SinOsc.ar( { |i| LFNoise2.kr( rrand(10, 20), 200, i + 3 * 100) } ! 10),
49 x.set(\spread, 1, \center, 0); // full n chans
50 x.set(\spread, 0.5, \center, -0.25); // less wide
51 x.set(\spread, 0, \center, 0); // mono center (depends on orientation, see PanAz)
52 x.set(\spread, 0, \center, -0.25); //
53 x.set(\spread, 0.0, \center, 0.5); // mono, but rotate 1 toward the higher channels
54 x.set(\spread, 0.5, \center, 0.5); // spread over the higher channels
55 x.set(\spread, 0, \center, -0.25); // all on first channel
56 x.set(\spread, 1, \center, 0); // full n chans
60 // the same example written with arFill:
62 x = { arg spread=1, level=0.5, width=2, center=0.0;
66 { |i| SinOsc.ar( LFNoise2.kr( rrand(10, 20), 200, i + 3 * 100) ) },
75 // or with mouse control
78 src = SinOsc.ar( { |i| LFNoise2.kr( rrand(10, 20), 200, i * 100 + 400) } ! 10);
79 SplayAz.ar(4, src, MouseY.kr(1, 0), 0.2, center: MouseX.kr(-1, 1));
83 // test for correct behavior:
85 { SplayAz.ar(4, SinOsc.ar * 0.2, orientation: 0) }.scope;
87 // on chan 0, 3, i.e. equally around the ring
88 { SplayAz.ar(6, SinOsc.ar([2, 3] * 200) * 0.2, orientation: 0) }.scope;
90 // equal spread on 0, 2, 4
91 { SplayAz.ar(6, SinOsc.ar([2, 3, 5] * 200) * 0.2, orientation: 0) }.scope;
94 // wrong behavior of SplayZ:
95 // plays on chan 2, but should play on 0
96 { SplayZ.ar(4, SinOsc.ar * 0.2, orientation: 0) }.scope;
98 // wrong: mixes both to chan 2,
99 // because pan values [-1, 1] are the same pos on the ring
100 { SplayZ.ar(6, SinOsc.ar([2, 3] * 200) * 0.2, orientation: 0) }.scope;
102 // wrong equal spread to pan values [-1, 0, 1], which outputs to chans 2, 0, 2
103 { SplayZ.ar(6, SinOsc.ar([2, 3, 5] * 200) * 0.2, orientation: 0) }.scope;