deprecate SCViewHolder-layRight
[supercollider.git] / SCClassLibrary / Common / Audio / Splay.sc
blobd790fc91e81d14dcb805a38a5ee506fcf269a489
1 Splay {
2         *ar { arg inArray, spread=1, level=1, center=0.0, levelComp=true;
3                 var n, n1; n = inArray.size.max(2); n1 = n-1;
5                 if (levelComp, { level = level * n.reciprocal.sqrt });
7                 ^Pan2.ar(
8                         inArray,
9                         ((0 .. n1) * (2 / n1) - 1) * spread + center
10                 ).sum * level;
11         }
13         *arFill { arg n, function, spread=1, level=1, center=0.0, levelComp=true;
14                 ^this.ar((function ! n), spread, level, center, levelComp)
15         }
18 SplayZ {
19         *ar { arg numChans=4, inArray, spread=1, level = 1, width = 2, center = 0.0,
20                         orientation = 0.5, levelComp=true;
22                 var n, n1; n = inArray.size.max(2); n1 = n-1;
23                 if (levelComp, { level = level * n.reciprocal.sqrt });
25                 "SplayZ is deprecated, because its geometry is wrong.
26                 Please convert to SplayAz.".inform;
28                 ^PanAz.ar(
29                         numChans,
30                         inArray,
31                         ((0 .. n1) * (2 / n1) - 1) * spread + center,
32                         1,
33                         width,
34                         orientation
35                 ).sum * level;
36         }
38         *arFill { arg numChans=4, n, function, spread=1, level=1, width = 2, center=0.0,
39                 orientation = 0.5, levelComp=true;
40                 ^this.ar(numChans, function ! n, spread, level, width, center,
41                 orientation, levelComp)
42         }
46 SplayAz {
47         *ar { arg numChans=4, inArray, spread=1, level = 1, width = 2, center = 0.0,
48                         orientation = 0.5, levelComp=true;
50                 var n = inArray.size.max(1);
51                 var moreOuts = numChans > n;
53                 if (levelComp, { level = level * n.reciprocal.sqrt });
54                 if (moreOuts, { inArray = inArray * level });
56                 ^PanAz.ar(
57                         numChans,
58                         inArray,
59                         ((0 .. n-1) / n * 2) * spread + center,
60                         1,
61                         width,
62                         orientation
63                 ).sum * if (moreOuts, 1, level);
64         }
66         *arFill { arg numChans=4, n, function, spread=1, level=1, width = 2, center=0.0,
67                 orientation = 0.5, levelComp=true;
68                 ^this.ar(numChans, function ! n, spread, level, width, center,
69                 orientation, levelComp)
70         }