CVCenter lets you collect an arbitrary number of CVs (you need to have the Conductor-quark installed) and use them to easily create control-widgets for Synths, Ndefs or Pattern-keys. Or even more basically: any value that can be set at runtime. For each CV a widget will be created within the main CVCenter-GUI that combines an arbitrary number of TabbedView2s, filled with your widgets.
What's a CV?
A CV models a value constrained by a ControlSpec. The value can be a single Float or an array of Floats. Whenever the CV's value changes, it sends a changed message labeled 'synch'. This way dependants (such as GUI objects or server value) can be updated with SimpleControllers. A CV's value can be read with the 'value' message.
Initializes CVCenter by creating its classvars all
, cvWidgets
and more private ones.
cvs |
an Array, a Dictionary or an Event, containing the widget name(s) and its/their internal CV(s): | ||||
... setUpArgs |
An arbitrary number of key/value pairs. The following keys are currently supported:
For a detailed description of the above listet arguments see the descriptions of the according classvar-methods. |
this
(CVCenter)
Creates and fronts the CVCenter GUI if it's closed or nil. Sends the GUI to front if it's in the background. If CVs are passed in as key/value pairs it adds them as widgets to the GUI under the given tab if given or the one that's currently in front.
tab |
a String or a Symbol, indicating the label of a tab. If none is provided the widgets will be added to "default" or any other tab that's currently in front. If an event containing the keys |
... cvs |
key/value pairs: |
this
(CVCenter)
Use an arbitrary name for creating a new CVWidget (a CVWidgetKnob or a CVWidget2D, depending on the argument slot
).
Stream
this method may directly be used in Pattern
s. If a CVWidget under the name given in *use
already exists it simply passes on the CV and returns before any other logic is executed. This should be fast enough even if executed at high rates.
You may omit the arguments slot
and tab
when creating a CVWidget2D if its first slot has already been created. However, if the widget is used within patterns you always must provide the slot as execution of the pattern depends on the right CV to be returned (if omitted the widget would return an event, composed of the \lo and \hi key).
key |
a Symbol or a String - the resulting CV will be put into CVCenter.all under this name and the widget will be labeled the same. If the given key resembles to the name of an existing ControlSpec it can be used automatically for the resulting CV's spec (if 'spec' hasn't been given explictely as the second argument). If the key consists of valid a ControlSpec-name and numeric characters only (e.g. 'freq 1' but not 'my freq') the spec's name will be extracted automatically. |
spec |
a ControlSpec - default: |
value |
a default value for the CV - default: the ControlSpec's default value |
tab |
a String or a Symbol - the tab under which the widget will appear. If not provided the widget will be added under the tab that's currently in front. |
slot |
only needed if a CVWidget2D shall be created. Either |
svItems |
if given, an SV will be returned instead of a CV (SV is a subclass of CV). An SV allows you to create dropdown menus, controlled by a CV. |
connectS |
a Boolean, indicating whether the resulting CVWidget's sliders should be connected instantly (fast moving sliders can put can put quite some weight on the CPU, so sometimes it may be useful to not connect them) |
connectTF |
a Boolean, indicating whether textfields in the resulting CVWidget should be connected instantly (see note on argument 'connectS'). |
a CV
Put new CVs into CVCenter
... args |
key/value pairs: |
this
(CVCenter)
It is possible to create GUIs from running Synths, NodeProxies (Ndefs as well as ProxySpaces) with one simple method-call. You can find thes methods documented in Synth: -cvcGui resp NodeProxy: -cvcGui.
For more complex SynthDefs the cvcGui-method will take care for special requirements like arrayed controls and treat them adequately.
If the user has already created widgets in CVCenter and wants to connect controls of a running Synth or a NodeProxy to these the following method might be suitable:
node |
mandatory - a Group, a Synth, a NodeProxy, an Ndef or a slot in a ProxySpace (pushed or not) whose controls shall be connected to the widgets in CVCenter. The objects can be given as variables (a, b, c, d...), environment-variables (~mySynth). Also variables can be given as strings/symbols (e.g. a as |
kvArray |
mandatory - an Array consisting of pairs of control-name(s) / widget-name(s):
|
environment |
optional - if the object is given as slot in an array or dictionary the method will try to look it up in the given environment. |
this
(CVCenter)
A simple example
s.sendBundle(s.latency, [...])
). However, these will address the object's nodeID. If the object gets removed and recreated with a new nodeID the actions will stop working.Different MIDI-devices may have different output modes: either values from 0-127 or an in-/decremental value (e.g. -1 or +1). These modes may be taken in account as follows:
0 | the device outputs a values 0-127 |
1 | the device outputs in-/decremental values |
midiMode
can be set at runtime and will be reflected in all widgets, i.e. all currently connectected devices will be switched to the new mode immediately.
default: 0
this
(CVCenter)
When midiMode
has been set to 1, this method allows to set the resolution (= stepsize) of the connected hardware MIDI-sliders.
standard-value: 1 lower values -> higher resolution (lower stepsize) higher values -> lower resolution (bigger stepsize)
default: 1
this
(CVCenter)
Some MIDI-devices provide several banks of sliders. I.e. a device may be equipped with 16 hardware-sliders and 4 banks that can be switched. So, slider 1 in bank 2 is slider nr. 17, slider 3 in bank 3 is slider nr. 35. By default these sliders would have to be addressed in a CCResponder as 16 (slider 17) and 34 (slider 35) which makes it hard to immediately get the right slider from what is displayed within the GUI. ctrlButtonBank
translates the hardware-layout in a way that makes it easy to see the slider's bank and number: slider 17 becomes 2:1 (bank 2, nr. 1).
default: nil
this
(CVCenter)
Devices which output a in-/decremtal may output a standard value + in-/decrement. midiMean
gets automatically subtracted from this value, so in-/decrement remains. Applies only if midiMode is set to 1
.
default: 64
this
(CVCenter)
If midiMode
has been set to 0
moving a widget-slider will set the CV to a new value. However, if a MIDI-slider is connected to that widget, moving the MIDI-slider will set the CV's value immediatly to the value that is stored in the MIDI-slider i.e. a "jump" will happen. softWithin
will ease this behavior by setting the CV's value only if the slider gets within softWithin/2
. Applies only if midiMode is set to 0
.
default: 0.1
this
(CVCenter)
Return the CV at the given key. If the key belongs to a CVWidget2D an Event will rather be returned, containing 2 CVs: \lo
and \hi
. If your code relies on a CV being returned by this method, make sure you call the right slot (e.G.: CVCenter.at(\myKey).lo
).
key |
Remove a given widget including its CV(s). . Existing OSC- or MIDI-connections will be resolved automatically.
key |
this
(CVCenter)
Remove given CVWidgets including their CVs or all. Existing OSC- or MIDI-connections will be resolved automatically.
... keys |
widget-keys, given as Strings or Symbols. If no keys are given all widgets will be removed. |
this
(CVCenter)
Add an action given in action
to a widget's CV given in key
under the name name
key | |
name |
a Symbol or a String - the name under which the action will be added. The action may be removed or deactivated again by referring to this name. |
action |
a Function or a String that compiles to a function - if one or more arguments are added, the first will automatically be a representation of the CV. The function can also be provided as a string that compiles to a function when you call |
slot |
a String or Symbol - either |
active |
a Boolean - activate or deactivate the action. default: |
this
(CVCenter)
Remove an action from a widget's CV given in key
under the name name
key | |
name |
a Symbol or a String - the name under which the action is stored. |
slot |
a String or Symbol - either |
this
(CVCenter)
Activates or deactivates an action at key
(representing the widget) and name
(the name under which the action is stored)
key | |
name |
a Symbol or a String - the name under which the action is stored. |
activate |
a Boolean
|
slot |
a String or Symbol - either |
this
(CVCenter)
Return the Adresses and OSC command names that are currently in use in an Array of arrays. The address denotes the address from which the regarding command is being sent. If no NetAddr is defined within the responder the address should be nil
. E.g.:
a nested Array
Returns currently saved snapshots - an Event holding snapshots under the timestamp or custom name when they were saved as key and an IdentityDictionary of keys and values of all current CVWidgets resp. their internal CV(s) as values
an Event
Save a snapshot of all values of all CVWidgets currently held in CVCenter. The snapshot will immediatly appear in the 'select snapshot' dropdown at the bottom of the CVCenter GUI. Selecting a snapshot will set the CVWidgets contained in the snapshot to its coresponding value in the snapshot.
dialog |
a Boolean denoting whether the snapshot name can be set in a dialog (default: |
this
(CVCenter)
Deletes all currently saved snapshots
this
(CVCenter)
Get or set the current bounds of the CVCenter GUI.
rect |
A |
this
(CVCenter)
Determine whether CVCenter resp. its childviews should always be on top of other views.
bool |
a Boolean |
this
(CVCenter)
A special method that allows the user to determine how many slots a multislider-widget shall display in 1 columns at max (even though this value refers to the maximum number od slots in one column a multislider-widget will always stretch over at least 2 colums). If this number gets exceeded a multislider widget will automatically stretch over 3 columns. default: 15
.
(value) |
an Integer indicating how many slots shall be displayed within one column. default: |
this
(CVCenter)
Returns true if no childviews exists (i.e. *childViews is empty) and the main window is closed (closing the main window should automatically close all childviews as well).
a Boolean
Set a tab-name from oldName
to newName
oldName | |
newName |
this
(CVCenter)
Get an Array containing all widgets (names) under the give tab.
label |
a String or a Symbol representing the name of the selected tab |
an Array
Get the tab label for the given widget name
wdgtName |
a Symbol, denoting the widget name |
the tab label as Symbol
Drawing sliders in a widget while they're moved from outside (e.g. when they're set from some other application outside SuperCollider via OSC) may cost a lot of CPU power. Via this method the connection to sliders and number boxes can be suspended and hence CPU power may be freed for other processes.
key |
a String or Symbol denoting the widget whose sliders, numberboxes shall be disconnected |
connectSliders |
a Boolean or |
connectTextFields |
a Boolean or |
this
(CVCenter)
Save all widgets and tabs resp. their actions, connected MIDI- and OSC-responders into a setup-file on disk. A once stored setup can be loaded again with loadSetup
and all its responders can get reinitialized automatically.
path |
optional - expects the full path to the location where the setup shall be stored disk. If given no file-save dialog will be displayed. |
this
(CVCenter)
Loads a saved setup and creates the CVCenter GUI with all widgets stored in the setup. For the user's convenience arguments for this method are defined explicitely, allowing the IDE to automatically list their names when the method's name gets typed. Also one may use the dialog provided by CVCenterLoadDialog that allows selecting options by checkboxes and dropdown-lists.
path |
optional - expects the full path to the location where the setup shall be stored to disk. If given no file-open dialog will be displayed. |
addToExisting |
If CVCenter GUI has already been initialized and contains some widgets and |
autoConnectOSC |
If set to |
oscConnectToIP |
If set to |
oscRestrictToPort |
If set to true all OSC-responders loaded from the setup will listen to the expliciit port stored with the setup (if a port has been saved with the setup). However, it is usually not recommended to restrict listening to a specific port as ports may easily change between sessions. Hence, this argument is set to |
activateCalibration |
If set to |
resetCalibration |
If set to |
autoConnectMIDI |
If set to |
midiConnectSrc |
If set to true MIDI-responders will only listen to the ID stored with the setup (if an ID has been stored with the setup). default: |
midiConnectChannel |
If set to true MIDI-responders will only listen to a channel stored with the setup (if a channel has been stored with the setup). default: |
midiConnectCtrl |
If set to true MIDI-responders will only listen to a controller-nr. stored with the setup. default: |
loadActions |
If set to |
midiSrcID |
Optional - all MIDI-responders will be initialized using this ID as an identification of the MIDI-device that is going to be used. Replaces any ID that has been saved with the setup. |
oscIPAddress |
Optional - all OSC-responders will be initialized using this IP-address. Replaces any IP-address stored with the setup. |
loadShortcuts |
If set to true currently active shortcuts in CVCenter, CVWidgets and CVWidgetEditors will be replaced by the shortcuts saved with the setup. By default saving a setup will always save all currently active shortcuts. default: |
this
(CVCenter)
an IdentityDictionary, containing all CVs added to CVCenter
all widgets (currently either CVWidgetKnobs or CVWidget2Ds) displayed within the main GUI of CVCenter
an IdentityDictionary, containing all CVWidgets
An IdentityDictionary keeping the parent windows of detached tabs: Any tab may be detached in this version of CVCenter as the GUI is now based on TabbedView2 instead of TabbedView. Moreover, tabs can be dragged between childviews (or the main window and a childview) by clicking its label and holding cmd (Mac) or ctrl (Linux, Windows). The structure of childViews
is the following:
An IdentityDictionary containing all currently defined shortcuts for CVCenter. Though this is a getter/setter it is recomended to add/remove shortcuts via the GUI within the preferences-interface (changes will become active after recompilation of the class-library) or the shortcuts-interface (changes become active immediatly but get reset after recompilation of the class-library).
See KeyDownActions for more information about the internal structure of the shortcuts
dictionary resp. the workings of shortcuts in general. Also have a look at the list of default shortcuts that can be modified by the user at any time.
An Event containing various objects that do not necessarily belong to CVCenter but are related to it. E.g. when a shortcut opens a window that window may be added to scv so other shortcuts can refer to it later. Basically scv
has been introduced as the concept of configurable shortcuts seperate shortcut-actions from CVCenter. Hence, variables in these actions can't get initialized belonging to CVCenter automatically. However, a classvar holding a dictionary that can be filled up later solves the problem.
an Event
The x-position at which the GUI will be created - has no direct effect besides when being set ahead from initializing CVCenter.
this
(CVCenter)
The y-position at which the GUI will be created - has no direct effect besides when being set ahead from initializing CVCenter.
this
(CVCenter)
The GUI-width - has no direct effect besides when being set ahead from initializing CVCenter.
this
(CVCenter)
The GUI-height - has no direct effect besides when being set ahead from initializing CVCenter.
this
(CVCenter)
multi-slider widgets can be used in patterns as well. However, their usage differs.
When CVCenter GUI is sent to front a number of shortcuts apply. Most of these shortcuts will open new windows. However, if the regarding window is already open (and maybe hidden under another window) it will rather be brought to front again than opened in another window.
wslib
is installed, open it.History.document
will only work with GUI-systems that support Document. When using the new SC-IDE consider using History.saveCS ( History.saveCS(path, forward)
)