1 class:: NodeProxyEditor
2 summary:: editor for a nodeproxy - replaced by NdefGui!
3 categories:: Libraries>JITLib>GUI
4 related:: Classes/NdefGui
9 NodeProxyEditor has been rewritten and renamed link::Classes/NdefGui::, which has the same functionality, but is both more consistent and more flexible. There are some changes to the strong::*new:: method:
12 ## instead of || *new(proxy, nSliders=16, parent, extras=[\CLR, \reset, \scope, \doc, \end, \fade], monitor, sinks, morph)
13 ## NdefGui uses || *new(object, numItems = 0, parent, bounds, makeSkip, options)
16 strong::proxy:: is now strong::object::, strong::nSliders:: is now strong::numItems::, strong::parent:: is still strong::parent::. strong::bounds:: - can be code::Rect(l, t, w, h):: or code::width@heights::, strong::makeSkip:: - is an option to build without skipjack. strong::extras:: are now strong::options::, and have become more flexible.
18 Please see link::Classes/NdefGui:: for more details.
21 NodeProxyEditor provides controls for handling and editing a node proxy and its monitors (cross-platform graphics).
24 ## sliders for numerical settings
25 ## mapping of kr proxies to parameters
26 ## optional controls for playing / monitoring
29 link::Classes/NodeProxy:: and link::Classes/Ndef:: implement an strong::edit:: message, which returns a link::Classes/NodeProxyEditor::. Overview: link::Tutorials/JITLib/JITLib::
38 Returns a new instance for a given proxy. If a window (win) or a composite view is given, it uses this.
45 p = ProxySpace.push(s);
48 ~test = { |freq=300, dens=20, amp=0.1, pan|
49 Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2), pan)
53 // make a NodeProxyEditor
54 n = NodeProxyEditor();
57 // some configuration options
59 n = NodeProxyEditor(~test, 6);
61 // the top line has a choice of elements:
62 \CLR button to clear proxy
63 \reset button to reset proxy nodemap
64 \scope button to scope proxy
65 \doc button to document proxy as code
66 \end button to end proxy
67 \fade EZNumber for setting fadetime
69 not in the default elements:
70 \rip button to open a new editor on the proxy (used in ProxyMixer)
72 \pausR a button to toggle pause/resume
73 \sendR a button to re-send; alt-click does Rebuild
79 // maybe provide later this?
80 \name -> { func }; // add your own element...
82 // The default buttons/controls are:
83 NodeProxyEditor(extras: nil, monitor: true, sinks: true);
85 NodeProxyEditor(extras: [\CLR, \reset, \scope, \doc, \end, \fade], monitor: true, sinks: true);
86 // if no monitor line, you can add pausR and sendR buttons
87 NodeProxyEditor(extras: [\CLR, \reset, \pausR, \sendR, \scope], monitor: false, sinks: false);
91 NodeProxyEditor(extras: [], monitor: false);
93 // not done yet - presets and morphing
94 NodeProxyEditor( morph: true);
96 // also works with Ndef
98 NodeProxyEditor(Ndef(\a));
100 // place in existing window
102 w = Window("testing");
103 n = NodeProxyEditor(nSliders: 6, win: w);
106 // too many controls: an EZScroller helps.
108 ~test = { |freq=300, dens=20, amp=0.1, pan, ping=12, tok=13, crak|
109 Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2), pan)
111 Spec.add(\dens, [0.1, 100, \exp, 0.01, 10]);
113 // gets specs for slider ranges from global lookup in Spec.specs:
114 Spec.add(\dens, [0.1, 100, \exp, 0.01, 10]);
117 ( // keys go away if not needed
118 ~test = { |freq=300, dens=20, amp=0.1|
119 Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2))
123 ( // and are added in order if needed
124 ~test = { |freq=300, intv=0, dens=20, amp=0.1, pan, pok, ting|
127 Dust.ar(dens ! 2, amp / (dens.max(1).sqrt)),
128 freq * [intv, intv.neg].midiratio, 0.2))
132 // changes in settings are shown:
133 ~test.set(\freq, exprand(100.0, 2000.0));
136 // mapping kr proxies to controls is shown
137 ~lfo = { LFNoise0.kr(8, 4) };
138 ~test.map(\intv, ~lfo);
141 Spec.add(\intv, ControlSpec(0, 24, \lin, 0.01, 0)); n.fullUpdate;
142 // setting a param value unmaps a previous control source
143 ~test.set(\freq, rrand(200, 500), \intv, rrand(-5.5, 5.5));
146 subsection::You can drag and drop proxies between NodeProxyEditors
150 // p = ProxySpace.push(s.boot);
152 l = NodeProxyEditor(nil, 3); l.w.bounds_(l.w.bounds.moveBy(0, 120));
153 m = NodeProxyEditor(nil, 3); m.w.bounds_(m.w.bounds.moveBy(0, 240));
154 n = NodeProxyEditor(nil, 3); n.w.bounds_(n.w.bounds.moveBy(0, 360));
155 o = NodeProxyEditor(nil, 3); o.w.bounds_(o.w.bounds.moveBy(0, 480));
157 Spec.add(\dens, [0.1, 300, \exp]);
159 // make 3 kinds of proxies: using tilde/proxyspace, Ndef, and unnamed.
160 ~spacy = {|dens=5| Formlet.ar(Dust.ar(dens ! 2), LFDNoise0.kr(20 ! 2).lag(0.1).linexp(-1, 1, 300, 5000), 0.003, 0.03) };
161 Ndef(\ndeffy, { GrayNoise.ar( 0.1 ! 2) });
162 c = NodeProxy.audio.source_({ PinkNoise.ar(0.1 ! 2) });
164 // put one in each editor
166 m.proxy_(Ndef(\ndeffy));