File: NodeProxyEditor.schelp

package info (click to toggle)
supercollider 1%3A3.13.0%2Brepack-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 80,292 kB
  • sloc: cpp: 476,363; lisp: 84,680; ansic: 77,685; sh: 25,509; python: 7,909; makefile: 3,440; perl: 1,964; javascript: 974; xml: 826; java: 677; yacc: 314; lex: 175; objc: 152; ruby: 136
file content (169 lines) | stat: -rw-r--r-- 5,152 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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
class:: NodeProxyEditor
summary:: editor for a nodeproxy - replaced by NdefGui!
categories:: JITLib>GUI, Live Coding
related:: Classes/NdefGui

description::

warning::
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:

definitionList::
## instead of || *new(proxy, nSliders=16, parent, extras=[\CLR, \reset, \scope, \doc, \end, \fade], monitor, sinks, morph)
## NdefGui uses || *new(object, numItems = 0, parent, bounds, makeSkip, options)
::

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.

Please see link::Classes/NdefGui:: for more details.
::

NodeProxyEditor provides controls for handling and editing a node proxy and its monitors (cross-platform graphics).

list::
## sliders for numerical settings
## mapping of kr proxies to parameters
## optional controls for playing / monitoring
::

link::Classes/NodeProxy:: and link::Classes/Ndef:: implement an strong::edit:: message, which returns a link::Classes/NodeProxyEditor::. Overview: link::Overviews/JITLib::

ClassMethods::

private::initClass

subsection::Creation

method::new
Returns a new instance for a given proxy. If a window (win) or a composite view is given, it uses this.

Examples::

code::
	// preparation
s.boot;
p = ProxySpace.push(s);

(
~test = { |freq=300, dens=20, amp=0.1, pan|
	Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2), pan)
};
)

	// make a NodeProxyEditor
n = NodeProxyEditor();
n.proxy_(~test);

	// some configuration options
	// number of sliders
n = NodeProxyEditor(~test, 6);

	// the top line has a choice of elements:
	\CLR 		button to clear proxy
	\reset		button to reset proxy nodemap
	\scope		button to scope proxy
	\doc		button to document proxy as code
	\end		button to end proxy
	\fade		EZNumber for setting fadetime

		not in the default elements:
	\rip		button to open a new editor on the proxy (used in ProxyMixer)

	\pausR		a button to toggle pause/resume
	\sendR		a button to re-send; alt-click does Rebuild

	\send		just send
	\rebuild	just rebuild
	\poll		poll the proxy

		// maybe provide later this?
	\name -> { func }; 	// add your own element...

	// The default buttons/controls are:
NodeProxyEditor(extras: nil, monitor: true, sinks: true);
	// these are:
NodeProxyEditor(extras: [\CLR, \reset, \scope, \doc, \end, \fade], monitor: true, sinks: true);
	// if no monitor line, you can add pausR and sendR buttons
NodeProxyEditor(extras: [\CLR, \reset, \pausR, \sendR, \scope], monitor: false, sinks: false);


	// barebones
NodeProxyEditor(extras: [], monitor: false);

	// not done yet - presets and morphing
NodeProxyEditor( morph: true);

	// also works with Ndef
Ndef(\a).ar;
NodeProxyEditor(Ndef(\a));

	// place in existing window
(
w = Window("testing");
n = NodeProxyEditor(nSliders: 6, win: w);
n.proxy_(~test);
)
	// too many controls: an EZScroller helps.
(
~test = { |freq=300, dens=20, amp=0.1, pan, ping=12, tok=13, crak|
	Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2), pan)
};
Spec.add(\dens, [0.1, 100, \exp, 0.01, 10]);
)
	// gets specs for slider ranges from global lookup in Spec.specs:
Spec.add(\dens, [0.1, 100, \exp, 0.01, 10]);
n.fullUpdate;

(	// keys go away if not needed
~test = { |freq=300, dens=20, amp=0.1|
	Pan2.ar(Ringz.ar(Dust.ar(dens, amp / (dens.max(1).sqrt)), freq, 0.2))
};
)

(	// and are added in order if needed
~test = { |freq=300, intv=0, dens=20, amp=0.1, pan, pok, ting|
	Pan2.ar(
		Ringz.ar(
			Dust.ar(dens ! 2, amp / (dens.max(1).sqrt)),
			freq * [intv, intv.neg].midiratio, 0.2))
};
)

	// changes in settings are shown:
~test.set(\freq, exprand(100.0, 2000.0));
~test.playN;

	// mapping kr proxies to controls is shown
~lfo = { LFNoise0.kr(8, 4) };
~test.map(\intv, ~lfo);
~test.unmap(\intv);

Spec.add(\intv, ControlSpec(0, 24, \lin, 0.01, 0)); n.fullUpdate;
	// setting a param value unmaps a previous control source
~test.set(\freq, rrand(200, 500), \intv, rrand(-5.5, 5.5));
::

subsection::You can drag and drop proxies between NodeProxyEditors

code::
(
// p = ProxySpace.push(s.boot);

l = NodeProxyEditor(nil, 3); l.w.bounds_(l.w.bounds.moveBy(0, 120));
m = NodeProxyEditor(nil, 3); m.w.bounds_(m.w.bounds.moveBy(0, 240));
n = NodeProxyEditor(nil, 3); n.w.bounds_(n.w.bounds.moveBy(0, 360));
o = NodeProxyEditor(nil, 3); o.w.bounds_(o.w.bounds.moveBy(0, 480));

Spec.add(\dens, [0.1, 300, \exp]);

	// make 3 kinds of proxies: using tilde/proxyspace, Ndef, and unnamed.
~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) };
Ndef(\ndeffy, { GrayNoise.ar( 0.1 ! 2) });
c = NodeProxy.audio.source_({ PinkNoise.ar(0.1 ! 2) });

	// put one in each editor
l.proxy_(~spacy);
m.proxy_(Ndef(\ndeffy));
n.proxy_(c);
)
::