2 summary:: mix control for a proxyspace
3 categories:: Libraries>JITLib>GUI
4 related:: Classes/ProxySpace, Classes/NdefGui, Classes/JITGui, Classes/MonitorGui, Classes/NdefParamGui
9 ProxyMixer has been updated - some little adaptations to existing uses may be needed. If you like, you can also replace "ProxyMixer" with "ProxyMixerOld" to keep using the old style of ProxyMixer.
12 ## strong::Old:: || strong::New::
13 ## ProxyMixerOld || ProxyMixer
16 ## nProxies, || numItems,
17 ## title, //is inferred from ProxySpace.asCode || parent, // a view to display proxymixer on, if nil, a new window is made.
18 ## where // can be set in bounds || bounds, // can be nil for default size, or a point for a specific location onscreen, or a Rect
25 ProxyMixer provides controls for handling and editing the node proxies in a proxyspace and their monitors (cross-platform graphics). It replaces the earlier ProxyMixer class. For Ndefs, use link::Classes/NdefMixer::.
27 Overview: link::Overviews/JITLib::
36 the proxyspace to show and control
39 how many ar and kr proxies can be shown
42 by default nil, so a window is made automatically. if a parent is supplied, the ProxyMixer will be shown there.
45 window bounds - default is nil, so it determines it size.
48 a flag whether to make make a skijack
51 additional settings - currently none provided.
57 p = ProxySpace.push(s.boot, p);
58 "abcde".do { |k| p[k.asSymbol].ar };
59 m = ProxyMixer(p, 8, options: [\playN]);
66 "abcdefghijk".do { |k| p[k.asSymbol].ar };
68 "lmnopqrtuvw".do { |k| p[k.asSymbol].kr };
70 "abcdefghijk".do { |k| p[k.asSymbol].playN };
74 // the top left menu sets which proxies will be shown.
76 // existingProxies: even an empty proxy is shown
79 ( // activeProxies: proxy appears when it is alive
80 ~test = { |freq=250, intv=19, timescale=1, curve=0, loopnode=0|
82 Env({ 1.0.rand2 }!11, {1.0.rand}!10, curve, releaseNode: 9, loopNode: loopnode),
83 timeScale: timescale);
84 var pitch = (env * [1, 0.33, -1] * intv).midiratio * freq;
85 Splay.ar(Formant.ar(pitch, pitch.scramble * 2, pitch.scramble)) * 0.1;
90 // playingProxies : only those that really play are shown.
93 // switch back to active proxies...
94 // the reduce button removes all proxies that are not playing
95 // and that are not used as sources in other proxies:
96 ~otto = { |dens=12| Dust.ar(dens) };
98 ~otto.clear; // remove it
101 // doc and docSel post the current proxyspace as code
104 // ProxyMixer has three preset widths:
105 m.switchSize(0); // ar zone only
106 m.switchSize(1); // ar + kr
107 m.switchSize(2); // ar = kr + edit zone
109 // R opens a Record utility, see below.
111 // the line of controls for one proxy and its monitor is
112 // a ProxyMonitorGui, so for full details see ProxyMonitorGui.help.
114 // it displays current volume,
118 // proxy name; play/stop/end control:
119 ~test.playN; // playN as is
121 ~test.end; // option-click on stop : end the monitor and the proxy itself.
122 ~test.playN(vol: 0); // option-click on play : start playing with volume zero.
127 ~test.playN(4); // set proxy's first output channel:
130 // the "-=" / "-<" button supports multichannel monitoring,
131 // see ProxyMonitorGui.help
133 // paus/rsum toggles pause and resume:
137 // send button resends the proxy,
138 // option-click on send rebuilds the proxy
139 // (e.g. for lookup in client-site state)
148 // the ed button sends this proxy to the editor - see below
150 // kr proxies show up in the middle
151 ~lfo = { SinOsc.kr(2) };
152 ~lfnoyz0 = { |lofreq = 0.5, mul=1, add| LFDNoise0.kr(lofreq, mul, add) };
154 // the editor zone is a NodeProxyEditor
155 // open it and set some params
157 m.editGui.object_(~test);
158 ~test.set(\freq, exprand(80, 1250)); // set ~tests parameters
159 ~test.set(\intv, 1.0.linrand);
161 // if you declare global specs for the range of a parameter,
162 // they can be used in the editor:
163 Spec.add(\intv, [0, 36, \lin]);
164 Spec.add(\timescale, [0.001, 10, \exp]);
165 Spec.add(\loopnode, [0, 7, \lin, 1]);
166 Spec.add(\curve, [-10, 10]);
168 m.editGui.object_(~test);
170 // you can map a kr proxy to a control param;
171 ~test.map(\intv, ~lfnoyz0);
173 // this also works by dragging the kr proxy name
174 // the field left of the param name.
178 // if there are too many ar proxies, a scroller appears
180 10.do { |i| p[("test" ++ i).asSymbol] = {
181 Pan2.ar(Ringz.ar(Impulse.ar(exprand(0.5, 4)), exprand(300, 3000), 0.02), 1.0.rand2, 0.2) };
185 10.do { |i| p[("test" ++ i).asSymbol].playN(vol: linrand(1.0), fadeTime: exprand(0.01, 5)) };
187 // and the same for kr proxies
188 10.do { |i| p[("kr" ++ i).asSymbol] = { LFNoise0.kr(exprand(5, 50)) }; };
190 p.krProxyNames.do { |key| p.removeAt(key) };
192 p.reduce(method: \clear);