CVCenter

Ever since I’ve discovered SuperCollider as a tool for making and playing around with sound I’ve been thinking about how I can make my life (and the life of others) a bit easier facing a constantly growing amount of code. Not that I don’t like coding in SuperCollider (sclang’s expressiveness and elegance was very much what I’d love to have when I had to work with other programming or scripting languages) but often there’s a fair amount of “non-creative” coding involved just to create a useable environment (e.g. GUIs, connecting external MIDI/OSC hard-/software). The basic idea behind CVCenter, respectively CVWidget and its subclasses CVWidgetKnob, CVWidget2D and CVWidgetMS (a multi-slider widget, introduced in this current version of CVCenter) is a clear separation of the GUI and its functionality: any widget serves as a controller for arbitrary functions which can be amended or removed at runtime.

Fortunately an object serving these demands has already been in place when I started working on CVCenter: CV from Ron Kuivila’sConductor library (certainly there would have been other ways to achieve what I wanted, e.g. SuperCollider’s inbuilt bus-architecture, yet it wasn’t my goal to reinvent the wheel). Additionally I wanted to simplify external control-communication as far as possible (currently MIDI or/and OSC). This current version of CVCenter offers a number of enhancements over the previous version:

CVCenter (all tabs attached)

CVCenter: detached tabs

CVWidgetMS in CVCenter

CVCenterPreferences: common settings

CVCenterLoadDialog

CVWidgetMS: a special multi-slider widget that allows setting an unlimited number of control parameters at a time. E.g. an envelope in a running synth may simply be redrawn with a mouse or the widget can be connected to a multi-slider in an OSC-controller on a mobile device. CVWidgetMSEditor: As connecting a CVWidgetMS to an OSC or MIDI device/application means connection each slot to a single command or command-slot (OSC), respectively controller (MIDI), I have designed this special interface that lets the user connect several slots of the widget at once (batch-connection) as well as all slots can be edited individually. A comprehensive preferences-editor that lets the user configure CVCenter and save settings to disk.

CVWidgetMSEditor: MIDI (batch-editor)

CVWidgetMSEditor: MIDI (individual slots)

CVWidgetMSEditor: OSC (batch-editor)

CVWidgetMSEditor: OSC (individual slots)

CVWidgetMSEditor: spec

CVWidgetMSEditor: actions

KeyDownActions: Integrated into the preferences editor but usable with arbitrary GUIs you will find an editor that lets you define or/and edit all shortcuts for CVCenter, all widgets within it and their editors. The editor is supposed to work platform-independent (OSX, Linux, Windows). If key-mappings should prove to be incorrect these may also be edited according to what your keyboard returns.

Roadmap

This current version of CVCenter is the result of ideas that had been lying in my drawer for quite some time already – especially the multislider widget. However, it has become yet another alpha version and there are a number features missing:

a widget (resp. a widget-slot) can only get connected with one OSC-responder and/or one MIDI-responder at a time. This is a conceptual flaw that I didn’t really consider when designing CVCenter and should be corrected.

The various CVWidgets still use OSCresponderNode resp. MIDIResponder instead of the more recent OSCFunc/def resp. MIDIFunc/def. This doesn’t really cause any inconvenience for the users – so far the concept has proven to work quite reliable.

Though the GUI concept is largely based on a MVC concept it isn’t really very modular. Especially while working on CVWidgetMS the limitations of the current concept became pretty clear.

I can’t make any promises on when I will be able to continue the development of CVCenter but when it happens it will certainly include the following:

Drop Cocoa support – not only has Qt become a fully qualified replacement, it also includes a number of features that would probably make creating GUIs a lot easier and offer more flexibility.

No limit on the number of OSC-/MIDI-responders within a given widget.

Modular GUIs: instead of creating a GUI out of basic elements (sliders, textfields, buttons etc.) define its elements in separate classes, each embedded in a global MVC scheme. The user might want to instantiate just a single element of GUI in her/his custom GUI. The MVC scheme would guarantee that the display of this element gets updated correctly.

Use OSCFunc/def instead of OSCresponderNode and MIDIFunc/def instead of MIDIResponder.

Motivation

As SuperCollider is a code-based environment GUIs aren’t strictly necessary to control the output but it may add some convenience. However, especially when GUIs get more complex it becomes increasingly difficult to keep different elements in sync as a user who doesn’t know much about the internal workings might expect. You will easily end up with lots of messy code that possibly doesn’t what wanted to achieve. Ron Kuivila’s Conductor lib resp. CV as part of it offers an elegant remedy here. Consider this simple example:

// create a slider and a number-box to set 'freq' in the running synth// the GUI in this form will only work using Qt// note that the slider has no action assigned~win = Window("set frequency");~slider = Slider(~win,40@300);~numBox = NumberBox(~win,Rect(50,0,100,20));~win.front;

// connect the CV to the slider and the number-box// voilà! both, slider and number-box will always be in sync~cv.connect(~slider);~cv.connect(~numBox);

A CVWidget basically wraps a CV in a GUI, adding simple connectability to external hard- or software. However, it should not interfere much with the way you work with SuperCollider: You may do prototyping, live-coding or other things. You should not waste your time with writing GUIs or creating responders. It should be as simple as that.

Installation

Prerequisites

CVCenter depends on TabbedView2 and (a modified version of) Conductor. Additionally you may want to install wslib and crucial-library. All of these can be installed through SC’s inbuilt Quarks package manager, except for Conductor which should be installed from its source on Github (there are some tweaks and fixes in that version that have not yet gone into the official version. Also it contains helpfiles written for SC’s new help system).

Install the old version of CVCenter as Quark

A version of CVCenter prior to this current one is available from SuperCollider’s integrated Quarks extension repository:
The version that can be obtained via Quarks will be the latest one only. However, the required dependencies will not be right. At this moment it is highly recommended to install from Github only.

Install the current (and the old) version of CVCenter from Github

In a terminal navigate to your userExtensionDir. Execute the following in SuperCollider to find out where that is:

1

Platform.userExtensionDir;

In a terminal use the path returned by the previous statement to navigate to your userAppSupportDir :

1

cd /path/to/userExtensionDir;

Clone the repository (a GIT client must already be installed).

1

git clone https://github.com/nuss/CVCenter.git

Subsequent updates can be done like this from within your cloned CVCenter directory:

1

git pull

If you intend to use CVCenter with the current development version of SuperCollider you should rather install Conductor as a submodule to CVCenter than install it via SC’s quark repository as it is not yet quite comatible due to the recent removal of the comapitibility with Cocoa.

1

git clone --recursive https://github.com/nuss/CVCenter.git

Subsequent updates can be done like this from within your cloned CVCenter directory:

1

git pull &amp;&amp; git submodule update

However, installing Conductor as a submodule should still be fully compatible with older versions of SuperCollider.

CVCenter should now be installed (if SuperCollider is already open recompile the class-library). If you want to switch to the old CVCenter version you may easily do so. Execute the following in a terminal and recompile the class-lib in SuperCollider again.

1

git checkout pre1.0

You may always determine easily which branch is currently active by executing the following in a terminal (you must be within the CVCenter directory within your userAppSupportDir).

1

git branch

Features

Aside from the already mentioned support for external MIDI and OSC CVCenter offers auto-GUI capabilities for running Synths, NodeProxies (Ndef, Proxyspace) and Instr/Patch. For any controls defined within these an adequate widget within the CVCenter GUI will be created resp. an action that updates the control’s value to the CV’s value. These actions may be amended by custom user-defined actions at any time. Also the user may create custom GUIs and its elements (sliders, number-boxes etc.) may be synced to a widget’s CV.