© 2013 Stefan Nussbaumer.
Creative Commons Lizenzvertrag
CVCenter

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 an arbitrary functionality, defined within functions that 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 (no online documentation available yet) from Ron Kuivila’s Conductor library (possibly there would have been other ways to achieve what I wanted, e.g. SuperCollider’s inbuilt bus-architecture, but 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:

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.

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.

Other classes, utilities that already existed in the previous version of CVCenter: CVWidgetKnob, CVWidget2D, CVWidgetEditor (improved), OSCCommands (improved).

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:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// create a CV with a defined ControlSpec
~cv = CV(\freq);
// add an action. Note that action_ creates a SimpleController
~controller = ~cv.action_({ |cv| ~synth.set(\freq, cv.value) });

// create ~synth
s.waitForBoot { ~synth = { |freq| SinOsc.ar(freq, mul: 0.3) }.play };

// 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.

AtomRecent Commits to CVCenter:master

Monday, September 15 2014, 22:47: fix CVWidgetEditor help, NodeProxy:-set (submodule)

Saturday, August 23 2014, 12:13: remove unnecessary arg

Saturday, August 23 2014, 12:11: bugfix: make sure CVWidgetMS gets initialized with correct numSliders

Tuesday, August 12 2014, 14:15: CVCenter.schelp: fix typos

Monday, August 11 2014, 14:27: minor flaw in CVCenter.schelp

Saturday, August 2 2014, 19:05: updated submodule Conductor

Friday, August 1 2014, 21:30: update Conductor help: CV.schelp

Friday, August 1 2014, 15:53: updates to submodule Conductor

Wednesday, July 30 2014, 11:38: rather recommend cloning via https than ssh

Wednesday, July 30 2014, 10:53: add Conductor as a submodule

Saturday, June 7 2014, 18:18: fix for weird CmdPeriod behavior

Thursday, May 29 2014, 00:06: remove redundant variable declaration

Monday, May 26 2014, 21:58: minor correction in helpfile

Saturday, May 3 2014, 19:59: prettify README

Tuesday, April 29 2014, 19:21: remove commented code

 

 

Installation

Currently the repository for CVCenter lives at https://github.com/nuss/cvcenter

Prerequisites

CVCenter depends on TabbedView2 and Conductor. Additionally you may want to install wslib and cruciallib

1
2
3
4
5
Quarks.install("TabbedView2");
Quarks.install("Conductor");
// optional
Quarks.install("wslib");
Quarks.install("cruciallib");

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:

1
Quarks.install("CVCenter");

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

The Quarks system is using Subversion behind the scenes and doesn’t support GIT which I am currently using for development. Unlike Subversion GIT offers the possibility of maintaining different branches in one repository which makes it easy for users to switch between e.g. a stable and a development version of one software. As I consider this current version of CVCenter to be a experimental version I’d recommend to check it out from Github rather than SuperCollider’s inbuilt Quarks system:

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 && 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.

Also CVCenter resp. the various CVWidgets may easily be used in Patterns.

Within the current version of CVCenter all shortcuts defined by default may be edited and new ones can be defined within a WYSIWIG editor.

One Trackback

  1. By CVCenter reloaded | pustota on 29 Dec ’13 at 5:13 pm

    […] CVCenter […]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>