'Monoming with SuperCollider' Tutorial

by: raja

Table of Contents:
Page1: Intro(this page)
Page2: Simple On/Off Synth
Page3: GUI
Page4: FX/Busses & Max/Javascript Familiarity (w/ Corners app)
Page5: Writing Classes (w/ 64fingers/MPC-style app)

This tutorial is for beginners with a basic knowledge of how to get around in SuperCollider(at the very least, poke around in the menus and learn keyboard shortcuts for executing/evaluating code selections, opening helpfiles for selected class names, and stopping). It's meant to get people started, but was not created with absolute expertise, while in hopes that more knowledgable supercollider users might modify or add to these tutorials to be more explanatory, comprehensive, and exact. Feel free to add or modify at will.

This is the main/official link for all things SuperCollider: http://supercollider.sourceforge.net/
(and if you're interested in history, this is the old official page where supercollider began: http://www.audiosynth.com/
by the original developer, James McCartney.)

With this tutorial alone, beginners will get results right away, but things will go much easier and quicker if you've read through some of the basic help documents either found within the 'Help' menu of SuperCollider itself or online here:
particularly the “Getting Started tutorial series” link there.

This page also has numerous helpful links:

The 'sc-users mailing list'(listed from the link just above) has been around since the beginning and is also a quintessential part of learning supercollider. A web-forum style interface for that same mailing list can be found here if you'd prefer:

Julius Orion Smith(teacher at CCRMA/Stanford) also has a “Getting Started With SuperCollider” tutorial here:

The JOS page listed above also links to an older more familiarly/commonly-used version of the help docs which outlines and categorizes things in a clearer(more easy-to-find), 'at-a-glance' way in my opinion: http://supercollider.svn.sourceforge.net/viewvc/supercollider/trunk/common/build/Help/Help.html

(However, the current help docs included in SuperCollider will show you everything you need, and everything that's included in the old docs, given you know the proper terms to type in the search or which headings to follow from the 'Browse' section.)

And just recently! A new SuperCollider wiki was started: http://supercollider.github.io/

Let's Do This! (Introduction)

Precursor: make sure your monome is setup for your comp properly and plugged in(follow the 'Setup' link from the monome docs page to setup your monome if you haven't already done so; FTDI driver and serialosc1.2a is required).

Device 'rotation' is '270' for most of these tutorial examples, except where noted. '270' means usb cable will be at the bottom(closest to performer, away from audience).

Step1 - If you haven't already, install SuperCollider, you can get it from here:

Step2 - Download this 'MonoM' class file:

Unzip the above file, and you'll find 2 files within. Drop the “MonoM.sc” file into your SuperCollider class library folder:

  • on Windows, the 'SCClassLibrary' folder (or similarly named) can be found within the SuperCollider program folder,
  • on Linux, it's found within the '/usr/share/SuperCollider/' folder,
  • and on MacOSX, you must right click on the SuperCollider app icon, choose “Show Package Contents” and then navigate from there to the 'Contents/Resources/SCClassLibrary' folder.

Step3 - Having placed the MonoM.sc file within the class library folder, startup SuperCollider, or if it's already running, make sure you recompile the class library(in the 'Lang' menu, choose 'Compile Library').

Step4 - Check to make sure everything is working by opening the 'MonoM.scd' file in SuperCollider and executing the code as instructed by the comments. (In SC, '.sc' extensions are for class files, and '.scd' extensions are for main/execution files.)

For Devs:
You can also find the files on github if you'd like to collaborate on development.
The files for this tutorial plus an added convenience subclass for Arc by Joseph Rangel are here:
(use the above if you'd simply like to add examples specific to this tutorial)

and just the class files for experienced developers who'd like to extend or improve functionality at Ezra Buchla's catfact github:
(use the above if you'd like to improve or extend a more official version which will be updated more frequently for communal use)

In SC, comments are delineated either by 2 forward slashes for a single line comment, or encased by '/*' and '*/' for multiple line comments.

To select an area of code within parentheses or brackets, double-click just after the first opening parentheses, or just before the last closing parentheses. This will highlight all the code within the parentheses, allowing you to execute just that section of code(as is instructed in the comments of the 'MonoM.scd' file). After selecting a section of code, execute it either by choosing Execute/EvaluateSelection from the 'Lang' menu, or by using the equivalent keyboard shortcut described in the same menu.

Finally, to complete the setup check, press on your monome and if you see the same button light up, then everything is working.

You may then try executing the single-line messages(one-by-one) to learn what they do: Each line near the bottom half of the 'MonoM.scd' file(starting with the line '~m1.rws;') shows a specific method/message which you can send to the MonoM object to perform a specific function. Most of the functions correspond to the osc led messages sent to the monome described here: http://monome.org/docs/tech:osc

Others allow you to query for the number of rows('.rws'), number of columns('.cls'), serialosc port number('.prt'), which monome to use out of all monomes connected to your comp('.useDevice' based on an indexed-list, or '.usePort' to specify by the exact serialosc port number a specific monome uses), and to perform proper garbage-collection/led-shutoff('.darkness').

“Why isn't button-press detection included in the class?”
Button press detection is left outside the class for you to define within your own “OSCFunc” because each user will want a button press to do something different in supercollider(whereas led messages would be the end result of a user-defined function, therefore can be predictable and formulaic, button-presses are often just the start of a user-defined function). So the button-press functions are left outside the class for the sake of open-endedness(you can easily create your own class that handles button presses and then simply include the MonoM class within that class to encapsulate everything all in one if you wanted to; writing classes will be explained later).

Now you're ready for the next tutorial section:

Supercollider_Tutorial: Page2