File: Splay.schelp

package info (click to toggle)
supercollider 1%3A3.11.2%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 71,152 kB
  • sloc: cpp: 387,846; lisp: 80,328; ansic: 76,515; sh: 22,779; python: 7,932; makefile: 2,333; perl: 1,123; javascript: 915; java: 677; xml: 582; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (81 lines) | stat: -rw-r--r-- 2,141 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
class:: Splay
summary:: Splay spreads an array of channels across the stereo field
categories:: UGens>Multichannel>Panners
related:: Classes/SplayAz, Classes/SplayZ

description::
Splay spreads an array of channels across the stereo field.
Optional arguments are spread and center, and equal power levelCompensation.
The formula for the stereo position is ((0 .. (n - 1)) * (2 / (n - 1)) - 1) * spread + center

classmethods::
method:: ar, kr
argument:: inArray
The array of channels to be distributed over the two stereo pairs
argument:: spread
For spread = 0, all channels end up in the centre, for 1, they have maximum distribution
argument:: level
An amplitude multiplier for all channels
argument:: center
Shift the centre of the distribution.
argument:: levelComp


method:: arFill
In analogy to Mix:arFill, this method takes a function that produces the channels. The counting index is passed to it.
argument:: n
Number of channels
argument:: function
Function to return each channel
argument:: spread
For spread = 0, all channels end up in the centre, for 1, they have maximum distribution
argument:: level
An amplitude multiplier for all channels
argument:: center
Shift the centre of the distribution.
argument:: levelComp

examples::

code::
(
x = { arg spread=1, level=0.2, center=0.0;
 Splay.ar(
  SinOsc.ar( { |i| LFNoise2.kr(1).exprange(200, 4000) } ! 10),
  spread,
  level,
  center
 );
}.play;
)

x.set(\spread, 1,   \center, 0);  // full stereo
x.set(\spread, 0.5, \center, 0);  // less wide
x.set(\spread, 0,   \center, 0);  // mono center
x.set(\spread, 0.5, \center, 0.5);
// spread from center to right
x.set(\spread, 0,   \center, -1); // all left
x.set(\spread, 1,   \center, 0);  // full stereo


 // the a similar example written with arFill:
(
x = { arg spread=1, level=0.2, center=0.0;
 Splay.arFill(10,
  { |i| SinOsc.ar( LFNoise2.kr( rrand(10, 20), 200, i + 3 * 100))  },
  spread,
  level,
  center
 );
}.play;
)


 // with mouse control
(
x = { var src;
 src = SinOsc.ar( { |i| LFNoise2.kr( rrand(10, 20), 200, i + 3 * 100) } ! 10);
 Splay.ar(src, MouseY.kr(1, 0), 0.2, MouseX.kr(-1, 1));
}.play;
)
::