A CVWidget2D is widget that can be used to set e.g. controls in running Synths, Ndefs, ProxySpace slots, NodeProxys, Patches and other other values that can be set at runtime. Also it may be used in connection with Patterns. Contrary to CVWidgetKnob and CVWidgetMS it holds two CVs.
Create a new CVWidget2D. To display the widget on screen you must call front on the resulting object.
parent |
an instance of Window or View - optional. If none is given the it will be created internally. |
widgetCV |
an Event of CVs - optional. If none is given it will be created internally. The array may hold |
name |
a String or a Symbol - optional. If none is given the widget will be named "knob". |
bounds |
a Rect - optional. If none is given the widget will be created with a default size. |
defaultActions |
an Event holding |
setup |
optional - an Event containing the following optional keys in two separate
|
controllersAndModels |
if a widget wraps a CV that has been created within some CVWidget the models and controllers of that other widget can be added here. CVWidget2D expects the parameters to be passed in in an Event containing the keys |
cvcGui |
a multi-purpose argument: usually you will not set anything here. It is used with the -open method resp. CVCenter. Within these it is used to pass in OSC-/MIDI-responders resp. the widgets MIDI-/OSC-environment. See also CVWidget: -midiOscEnv |
persistent |
if set to |
server |
only used for SwingOSC compatability (untested) |
only used for SwingOSC compatability (untested) this (a CVWidget2D
)
If a widget has been created with the argument persistent
set to true the user may reopen the widget with this method. This is basically a workaround due to the fact that GUIs in SuperCollider usually can't be opened again once they have been closed (even though executing the variable storing the the regarding object still returns the object). However, rather than reopening the old widget this method will create a new one, holding all properties, the CV and MIDI-/OSC-responders. In order to make this work as desired one should apply the following syntax where x
holds the instance of the initially created widget:
x = x.open // the old widget was stored in x which will afterwards hold the new widget
See example in CVWidget: reusable_widgets
window |
a Window or |
wdgtBounds |
a Rect or |
a CVWidget2D
\lo
and a \hi
element. Basically all of the following elements are getters but not setters. However, it is possible to change the value returned in \lo
or \hi
as they are simply values within an Event - do not attempt to do so or unexpected things will happen!The Slider2D on the top of the left side of the widget. It allows the user to set two values at once. The horizontal axis of the slider represents the value of widgetCV.lo, the vertical axis the value of widgetCV.hi.
a Slider2D
The RangeSlider on the bottom of the Slider2D. It allows the user to set two values at once. The left end of the bar represents the the value of widgetCV.lo, the right end the value of widgetCV.hi.
An Event containing two NumberBoxes, displaying or setting the current value of the widget's CVs.
an Event
An Event containing two Buttons, linking to the regarding spec-tab within the widget's editor ( \lo
or \hi
) (see also: CVWidgetEditor)
an Event
An Event containing two Buttons linking to the regarding MIDI-tab within the widget's editor ( \lo
or \hi
) (see also: CVWidgetEditor)
an Event
An Event containing two Buttons ( \lo
or \hi
) that, if clicked, either triggers the MIDI-learn functionality (button-label: "L") or creates a CCResponder for the values entered in -midiSrc, -midiChan or/and -midiCtrl (button-label: "C"). If a CCResponder is present the button-label gets changed to "X" - upon clicking the responder gets removed again.
an Event
An Event containing two TextField
s ( \lo
and \hi
), each displaying the ID of a connected MIDI-device. If no CCResponder is present one may enter the ID of a device (if known) and when clicking the -midiLearn button the widget will create a CCResponder listening to that device.
an Event
An Event containing two TextField
s ( \lo
and \hi
), each displaying the channel for an existing CCResponder or, if none is present, one may use this field to set the channel for which the CCResponder shall be created.
an Event
An Event containing two TextField
s ( \lo
and \hi
), each displaying the controller-number of an existing CCResponder or, if none is present, one may use this field to set the controller-number for which the CCResponder shall be created.
0
- if 0
gets entered here the controller will be displayed as 1
as most devices will probably number their knobs and sliders beginning with 1
. Also, the way controller-numbers are displayed is related to the ctrlButtonBank
setting which can be set with CVWidget: -setCtrlButtonBank
an Event
An Event containing two Buttons ( \lo
and \hi
) that link to the widget's OSC-tabs within the regarding CVWidgetEditor. If an OSCresponder is present, the button-label will display the command-name, the message-slot and the current OSC-mapping (if the button is big enough to display all this information - mapping can be \linlin
, \linexp
, \explin
or \expexp
).
an Event
An Event containing two Buttons that link to the OSC-tabs within the regarding CVWidgetEditor, displaying the current calibration-status.
an Event
An Event containing two Buttons, each linking to the actions-tab within the widget's regarding CVWidgetEditors. The button displays the number of active actions resp. existing actions in total.
an Event
Get or set the background-color of the widget. Tne setter for this method is implemented within CVWidgetMS while the getter is implemented as a global getter for all CVWidgets in CVWidget.
color |
a Color |
a Color (getter) or this
(a CVWidgetMS
) (setter)
Get or set the string-color of the widget. Tne setter for this method is implemented within CVWidgetMS while the getter is implemented as a global getter for all CVWidgets in CVWidget.
color |
a Color |
a Color (getter) or this
(a CVWidgetMS
) (setter)
See examples in CVWidget: examples