SuperCollider CLASSES

NdefParamGui

display the settings of a nodeproxy
Inherits from: EnvirGui : JITGui : Object

Description

NdefParamGui displays all settings and mappings of a nodeproxy, so one can change them flexibly. Single number get displayed with an EZSlider, and anything else is shown as an EZText (a text field). Its main use is within NdefGui.

It inherits some useful methods from EnvirGui.

Class Methods

Creation

*new (object, numItems: 8, parent, bounds, makeSkip: true, options: [ ])

From superclass: EnvirGui

create a new NdefParamGui

// simple example - see also NdefGui!

g = NdefParamGui.new(nil, 5);    // empty with 5 slots
g.parent.alwaysOnTop_(true);
g.object_(Ndef(\a));        // put in a nodeproxy
Ndef(\a, { |freq = 300, amp = 0.2| SinOsc.ar(freq) * amp ! 2 }).play;
Ndef(\a).set(\freq, 200);    // add a setting
Ndef(\a);
g.object_(nil);            // put in nothing

g.object_(Ndef(\a));         // put in a nodeproxy
Ndef(\a).set(\amp, 0.125);    // add a setting
Ndef(\a, { |freq = 300, amp = 0.2| SinOsc.ar(freq) * amp });
Ndef(\a).set(\freq, 234);    // add a setting

Ndef(\a).play
Ndef(\lfo, { LFNoise0.kr([12, 8], 200).sum + 500 });
Ndef(\a).map(\freq, Ndef(\lfo));// mapped proxies are shown

g.useRanger = false;

//Multichannel controls are shown in EZText
g.putSpec(\freqs, \freq);
Ndef(\a, { |freqs = #[300, 303], pan, amp = 0.2| SinOsc.ar(freqs).sum * amp });
Ndef(\a).play
Ndef(\a).setn(\freqs, [300, 350])
Ndef(\a).setn(\freqs, [330, 350])
Ndef(\a).set(\harm, 123)

Ndef(\a).nodeMap.clear

Ndef(\lfos, { LFNoise0.kr([12, 8], 200) + 500 });
Ndef(\a).map(\freqs, Ndef(\lfos))

g.parent.close

Arguments:

object

the nodeproxy whose settings are to be displayed.

numItems

the number of items to display. If an envir is given, and no num, num is envir.size.

parent

the parent view to display in; if none is given, a new window is created.

bounds

the bounds within which to display; if none is given, bounds are calculated.

makeSkip

flag whether to make a skipjack to manage updates of the envirgui. default is true.

options

a list of additional information, e.g. flags about optional buttons.

Inherited class methods

Instance Methods

-name = name

From superclass: EnvirGui

if in its own window, set the window's name

g.name = "Yoohoo";

Inherited instance methods

Undocumented instance methods

-accepts (obj)

-checkUpdate

-dragAction (i)

-drags

-getState

-makeViews

-setByKeys (newKeys, newSettings)

-setDefaults

-setFunc (key)

-showFields (num: 0)

Examples

    // put an NdefParamGui in an existing window - margin becomes 0@0
(
w = Window().front;
w.addFlowLayout;
g = NdefParamGui(Ndef(\a), 3, w);
NdefParamGui(Ndef(\c), 15, w);
)
    // even
Ndef(\c).set(\otto, 123, \mops, [1,2,3], \kotzt, [0, 6, 0, 6]);
Ndef(\c).nodeMap.clear;