Wednesday, 21 May 2008

SuperCollider for Human Beings

This time with gedit support!!!

And here's a short hands-on tutorial, just in case anyone would like to try out this extremely efficient synthesis environment for the first time...

UPDATE:The best way to get semi-official SuperCollider packages is the SuperCollider PPA. Check its page for instructions on adding the repository.

After you've successfully added the PPA to your software sources, install supercollider and supercollider-gedit packages.

Then start gedit and open Edit->Preferences. Enable Sced plugin from the Plugins tab:

Okay, now we can try the interpreter. Select Tools->SuperCollider Mode from the gedit menu. The SuperCollider output panel will appear with a message that SuperCollider has started. Now type the following code just inside the currently open document:
"Hello, World!".postln;
Make sure that the cursor is on the same line and press CTRL+E. You should see "Hello, World" printed two times in the output window. The string is duplicated because "postln" returned the same string as a value, and the output also prints the results of the evaluated expressions.

If you'd like to get some sound, make sure that JACK is started. If not, start it with qjackctl or the following command:
jackd -d alsa
After JACK has started, select SuperCollider->Start Server from the gedit menu and execute the following code string, just like we did with the "Hello, World" example above:
You should hear an annoying beep from your left speaker. Not much, huh? Well, press ESC (Stop Sound) inside gedit for now. And append something like the following code to your document (yes, you can do all the work in the same document):
// This example is a modified patch
// from the SuperCollider book by David Cottle
// You can enable syntax highlighting
// by selecting View->Highlight Mode->Others->SuperCollider
( // press CTRL+E here
{,[5, 5], mul: 440, add: 880),
    mul: 0.25
Note the brackets around the actual code. They're used to group code together into "blocks" and execute SuperCollider instructions simultaneously. In this example you will need to press CTRL+E where indicated to select and run our block. Remember, that you can shutdown the sound anytime with ESC! :)

As you can see, we have a Saw oscillator, connected to a resonant low-pass filter (RLPF) here and the cutoff frequency is controlled by an interpolated random value (LFNoise1). You can open reference pages for the respective modules (UGens) by positioning the cursor over them and pressing CTRL+U, but make sure that you install supercollider-doc package to get those.

Well, I hope this tutorial will help you get started with SuperCollider. Make sure you also stop by the SuperCollider website and the wiki for more tutorials and examples.


  1. Yeah! We just installed supercollider on 18 classroom machines in less than 30 minutes thanks to you. Could you do a follow-up showing how to install SwingOSC along with your packages. I tried the default SwingOSC instructions and couldn't get it to work.

  2. Hi, Jaime! You can install SwingOSC very quickly as well by copying the contents of SuperCollider/SCClassLibrary directory from to:

    (You'll get /usr/share/SuperCollider/Extensions/SwingOSC)

    Copy the "Help" directory to the Extensions folder as well, if you need interactive help.

    Then place build/SwingOSC.jar anywhere you like and evaluate the following command before starting the GUI server:

    SwingOSC.program = "/path/to/swingosc/SwingOSC.jar";

    I usually put the jar in my home directory. Then you won't even need to specify SwingOSC.program :)

  3. Hi artfwo,

    I'm new to supercollider on linux, just switching from Max/MSP. I would like to ask you about the startup file for supercollider. There is nothing on my home folder and would like to have it load my SwingOsc.jar location on startup (placing it in home doesn't work for some reason).
    I'm using your gedit plugin which works great, I was wondering if it would be possible to launch gedit from a scrip so it switches to supercollider mode and activates the syntax colors.

    Thanks in advance and keep up the good work.


  4. Miguel, the startup file for SuperCollider would be ~/ Try placing the following code inside the startup file:

    SwingOSC.default.boot; GUI.swing;

    This should start SwingOSC automatically. Also, make sure that SwingOSC.jar is in your home directory (or the directory you start gedit from). Hope this helps :)

  5. Thanks for this short and sweet howto and your time saver packages!

  6. I know this is an old post, but I really appreciate your work in making these packages available along with some helpful directions. Thank you!

  7. HI,

    I've been using 7:10 - I have an older computer (Omnibook XE3). Is there a 7:10 workaround for the dependencies?


  8. No, there's no version for 7.10, but I'm going to try and build this one for you as well, stay tuned!

  9. Visruth Ram K V15 November 2008 22:16

    Thankz lot for u'r grt info
    Really it ws very much useful for me

  10. A little update on this. The packages are now built on an almost weekly basis for Jaunty, Intrepid and Hardy.

    Unfortunately, no builds for 7.10 yet, because Scons in Gutsy does not have --install-sandbox option, that is crucial for the current build scripts (and is very useful for building debs out of Scons-based software in a sane way). Sorry, but I have to give up building these, please consider upgrading at least to Hardy.

  11. Thanks a lot for this tutorial! Everything working in Ubuntu 8.10. Been using MAX and PD, but this SC is amaising...
    I also added the swingOSC sartup script and works (although I do get some errors but the tutorial examples work)

    Just to add my token: to copy the SwingOSC zip contents to the /usr/share on my system I had do it as su.

    Thanks again and kind regards,

  12. Thanks a lot for this. One problem I'm having is I can't pull up help files from within arguments, also 'Help' from the pulldown menu doesn't work. Any ideas? Do I need to put the helpfile anywhere??

  13. Do you mean that the Find Help shortcut does not work for you? Do you use Gedit, Emacs, or Vim? Do you have supercollider-doc package installed?

  14. neither the shortcut or the tool bar. I get error messages (tried to post here but the blog reads them as html and won't accept them. I'm using gedit, and suod apt-get install confirms I have th elatest version installed

  15. Could you please E-mail the log messages to me, so that I could check what's wrong for you? (artfwo KLMRF gmail DOT com)

  16. Just a public 'thank you' to Artem for helpingme solve the above problem

  17. hi artfwo,

    unfortunately i have not been able to install swingosc. when starting gedit in supercollider mode, i get the following output:

    compiling class library..
    NumPrimitives = 544
    compiling dir: '/usr/share/SuperCollider/SCClassLibrary'
    compiling dir: '/usr/share/SuperCollider/Extensions'
    pass 1 done
    ERROR: Class extension for nonexistent class 'SCDragView'
    In file:'/usr/share/SuperCollider/Extensions/SwingOSC/'

    ...and a couple of additional error messages. could you please tell me what is wrong?

  18. That's okay, those error messages can simply be ignored, and swingOSC will work.

  19. thanks for this post!

  20. It doesn't look like supercollider is installable on Intrepid 64-bit...

    Any ideas?

  21. Well, the only non-dev package, installable on amd64, is the server (deb here). Is it uninstallable directly for you as well?

    Oh, and would you provide more details (error messages, if any)? Thanks.

  22. Hi,

    sorry a definite beginner here... I got everything working except the SwingOSC... I followed the directions here, as well as the directions on the Swing OSC site, both ways when I open SC it still says

    GUI.fromID : The GUI scheme 'swing' is not installed
    The current scheme is still 'nil'!

    And when I run the command I get

    ERROR: Class not defined.
    in file 'selected text'
    line 1 char 8:
    SwingOSC•.program = "/path/to/swingosc/SwingOSC.jar";

  23. Marc, have you copied the SwingOSC classes (*.sc) into ~/share/SuperCollider/Extensions/SwingOSC?

    I have the classes in the following directories:


  24. Hey thank you for your great work!!
    Everything is running fine, except one thing:
    I'm a beginner as well, and I'm wondering if the missing classes (e.g. etc.) can be found anywhere? Some of the tutorials are using the SCWindow class for example, and,thus,they don't work. What can I do to fix that?

    ... and perhaps you should enter the correct path instead of "/path/to/swingosc/" (if that's the original error message you get).


  25. It looks like the missing classes problem (SCDragView, etc.) is no longer a problem with the latest SwingOSC preview release (swingosc-preview-0.61), available from the SwingOSC project page.

    I'm unable to test it myself right now (no Java), but the interpreter loads without an error. Woot!!

  26. yupp, the error msgs at startup have disappeared. but the problem is still there. I get an "Class not defined" error, when I'm trying to use SCDragView for example. (This classes are not included in the swingOSC .zip file). Are they obsolete? As I said I'm an absolute beginner with SC, so maybe it's just somthing, taht I don't understand...

  27. SCDragView works for me right now. If you're using Ubuntu packages from PPA, please try upgrading to 3.3~svn8801 first...

    Then, I suppose, it's best for you to remove all the SwingOSC traces from /usr/share/SuperCollider and ~/share/SuperCollider, download SwingOSC Preview-0.61 and run the following commands as your regular user:

    1. unzip
    2. mkdir -p ~/share/SuperCollider/Extensions
    3. cp -a SwingOSC/SuperCollider/SCClassLibrary/SwingOSC ~/share/SuperCollider/Extensions
    4. cp SwingOSC/build/SwingOSC.jar ~

    And (optional) remove the unzipped sources:
    5. rm -rf SwingOSC

  28. Hi,
    is there a way to specify in sced the supercollider folder? When i install supercollider on ubuntu it is in the folder /usr/share/. but when i start supercollider from gedit with sced, it wants to compile the class library in /usr/local/share/Supercollider.
    I have to move my installation from /usr/share to /usr/local/share in order to be able to use supercollider.

  29. Hi! There's not. Sced simply runs sclang, which is being found in your $PATH, and if sclang has been compiled/installed into /usr/local, it will pick up the class library from /usr/local as well.

    So, you'll have to check if you've got sclang/scsynth binaries in /usr/local/bin first. And get rid of 'em, but that depends on which SuperCollider you'd like to keep.

  30. Thank you very much. It was the perfect solution for my problem. I use the supercollider version which i install through apt-get but i compiled it once from the sources, thats why there was sclang in /usr/local/bin. thanks

  31. Thanks much for these directions. Worked like a charm for SC. (Though I ended up using sc-emacs instead of sc-gedit.)

    Here's what I did to make SwingOSC work on a Ubuntu install:

    1) Fetch swingOSC:

    2) unzip

    3) sudo mkdir -p /usr/share/SuperCollider/Extensions

    4) sudo cp -a SwingOSC/SuperCollider/SCClassLibrary/SwingOSC /usr/share/SuperCollider/Extensions

    5) sudo cp SwingOSC/build/SwingOSC.jar /usr/share/SuperCollider/Extensions/SwingOSC

    Then start up your SC program with:




    And it works! Woot.

  32. hi!
    am on intrepid and did the:
    apt-get install supercollider
    apt-get install supercollider-vim
    to do the scvim

    well ... didn't make any dir in my ~ .. but anyway just did a first try for the command:

    but the result was:

    Error detected while processing command line:
    E492: Not an editor command: SClangStart
    Press ENTER or type command to continue

    am using dwm as wm
    and did the command on terminator

    was away from sc for a while and like dicided only to take advantage on it when booting pure:dyne .. but if your package is gonna make things simple for me .. yes i'd like to go sc@ubuntu once again


  33. Right, supercollider-vim is now packaged to conform with the new policy for packaging Vim addons: they're not enabled by default. If you want to enable it for your user account just execute:

    vim-addons install supercollider-vim

    Similarly, to enable it for all users of this system just execute (as root):

    vim-addons -w install supercollider-vim

    vim-addons is provided by the vim-addon-manager package, that is not specified as a dependency for current builds of supercollider-vim. This will be fixed (with a proper README) as soon as I package the release candidate for 3.3.

  34. my english reading is not good enough but this is what you mean in the last sentence?

    ~/podp# apt-get install vim-addon-manager
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    The following NEW packages will be installed:
    0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
    Need to get 13.7kB of archives.
    After this operation, 127kB of additional disk space will be used.
    Get:1 intrepid/universe vim-addon-manager 0.4 [13.7kB]
    Fetched 13.7kB in 1s (12.7kB/s)
    Selecting previously deselected package vim-addon-manager.
    (Reading database ... 83794 files and directories currently installed.)
    Unpacking vim-addon-manager (from .../vim-addon-manager_0.4_all.deb) ...
    Processing triggers for man-db ...
    Setting up vim-addon-manager (0.4) ...
    ~/podp# vim-addons install supercollider-vim
    Warning: Ignoring unknown addons: supercollider-vim
    ~/podp# apt-get install supercollider-vim
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    supercollider-vim is already the newest version.
    0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.

  35. Oops, sorry! My mistake... Please try to run "vim-addons install supercollider" instead. This have been tested to work properly for sure.

  36. yes!! it came out at last!
    i warns me about swing but i won't use it so ignored
    and tested my superold code and ..
    the sound is here ..
    i didn't imagine it would be this easy!!
    i didn't even create ~/share/supercollider by myself
    maybe the package system did it for me?
    am always using the system as root and not using the rt kernel
    so didn't have to add anything for that limit something
    i think am back to the sc's world
    thank you sooooooooooooooooooo much!

  37. so i added the keys, and updated my sources.list.

    and i run the install command and i get this..

    I am running ubuntu intrepid.

    sudo apt-get update && sudo apt-get install supercollider supercollider-gedit
    Hit intrepid Release.gpg
    Ign intrepid/main Translation-en_US
    Ign intrepid/universe Translation-en_US
    Hit intrepid Release
    Hit intrepid/main Packages
    Hit intrepid/universe Packages
    Hit intrepid Release.gpg
    Ign intrepid/partner Translation-en_US
    Hit intrepid-security Release.gpg
    Ign intrepid-security/main Translation-en_US
    Ign intrepid-security/restricted Translation-en_US
    Get:1 intrepid Release.gpg [307B]
    Ign intrepid/main Translation-en_US
    Hit intrepid Release.gpg
    Ign intrepid/free Translation-en_US
    Hit intrepid Release.gpg
    Ign intrepid/main Translation-en_US
    Hit intrepid Release
    Ign intrepid-security/universe Translation-en_US
    Ign intrepid-security/multiverse Translation-en_US
    Hit intrepid-security Release
    Get:2 intrepid Release [46.7kB]
    Ign intrepid/non-free Translation-en_US
    Hit intrepid Release
    Ign intrepid/restricted Translation-en_US
    Ign intrepid/universe Translation-en_US
    Ign intrepid/multiverse Translation-en_US
    Hit intrepid-updates Release.gpg
    Ign intrepid-updates/main Translation-en_US
    Ign intrepid-updates/restricted Translation-en_US
    Hit intrepid/partner Packages
    Ign intrepid-updates/universe Translation-en_US
    Ign intrepid-updates/multiverse Translation-en_US
    Hit intrepid Release
    Ign intrepid/main Packages
    Hit intrepid-security/main Packages
    Hit intrepid/free Packages
    Hit intrepid/partner Sources
    Hit intrepid-updates Release
    Ign intrepid/main Sources
    Hit intrepid-security/restricted Packages
    Hit intrepid-security/main Sources
    Hit intrepid-security/restricted Sources
    Hit intrepid-security/universe Packages
    Hit intrepid/non-free Packages
    Hit intrepid/main Packages
    Hit intrepid/restricted Packages
    Hit intrepid/main Sources
    Hit intrepid/restricted Sources
    Hit intrepid/universe Packages
    Hit intrepid/main Packages
    Hit intrepid-security/universe Sources
    Hit intrepid-security/multiverse Packages
    Hit intrepid-security/multiverse Sources
    Hit intrepid/universe Sources
    Hit intrepid/multiverse Packages
    Hit intrepid/multiverse Sources
    Hit intrepid-updates/main Packages
    Hit intrepid-updates/restricted Packages
    Hit intrepid-updates/main Sources
    Hit intrepid-updates/restricted Sources
    Hit intrepid/main Sources
    Hit intrepid-updates/universe Packages
    Hit intrepid-updates/universe Sources
    Hit intrepid-updates/multiverse Packages
    Hit intrepid-updates/multiverse Sources
    Fetched 308B in 1s (175B/s)
    Reading package lists... Done
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package supercollider is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package supercollider has no installation candidate
    randy@randy-laptop:/etc/apt$ sudo apt-get install supercollider
    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    Package supercollider is not available, but is referred to by another package.
    This may mean that the package is missing, has been obsoleted, or
    is only available from another source
    E: Package supercollider has no installation candidate

    if i can get this to work on my machine i wont have to switch to windows for audio production!
    plz help!
    thank you

  38. 2whale-fins: A friend of mine has successfully installed supercollider for Intrepid from the PPA several minutes ago. Please check if everything is okay with your sources.list and re-run "apt-get update". The appropriate line for Intrepid would be:

    deb intrepid main

    Perhaps, there could be a problem with Launchpad at the time you tried to update APT cache... Email me if you have further problem with the packages (the address is in the sidebar to the right).

  39. Anyone had any luck using a Wii Remote with supercollider? I've been trying things left and right, and can't make any progress. I've heard it's not that hard. :(

  40. Yes, it's very easy. See the WiiMote helpfile for an example (worked for me without problems).

  41. today i wanted to view the help in scim
    so i did :SChelp as it says so when sc gets booted

    help tag cache does not exist, you must run SCVim.updateHelpCache in supercollider in o
    rder have help docs
    Error detected while processing function SChelp:
    line 6:
    E149: Sorry, no help for SC:SCVim
    Press ENTER or type command to continue

    hmm...what's that "in supercollider" sayin?

  42. sorry i was so stupid...
    i just had to run SCVim.updateHelpCache
    in the SCVim window that i opened ;D

  43. I can't seem to get the install to work on jaunty. I've added:

    deb jaunty main
    deb-src jaunty main

    to the end of my /etc/apt/sources.list, and then ran

    sudo apt-get update && sudo apt-get install supercollider supercollider-gedit

    with the result:

    Reading package lists... Done
    Building dependency tree
    Reading state information... Done
    E: Couldn't find package supercollider

    What gives? Any idea?

  44. tacitdynamite, that is strange, because Jaunty packages are even built for amd64 now and they're residing in the pool.

    Could you try to run "sudo apt-get update" separately and email the output to me? (together with your sources.list)

  45. artfwo, this morning I ran "sudo apt-get update" and then ran sudo apt-get update && sudo apt-get install supercollider supercollider-gedit again, and this time it installed just fine. I'm not sure what the deal was. Thanks for your fast help! Great tutorial.

  46. Thanks so much the first thing that I have got to work on Ubuntu . Just one thing can't find the start-up file to add that code ... where would it be ?

  47. If you mean the startup file for sclang, that would be "", which must be stored in your home directory. Hope that helps!

  48. Is there an easy way to install sced on karmic koala? I'm lost.

  49. Karmic packages are currently residing in this PPA:

    I guess we shall update the builds in the supercollider PPA as well, when we have a new release or a little spare time.

  50. having an issue in ubuntu studio 10.04, sclang error: can't find libicui18n.so38
    i believe so42 is installed...

  51. Hi, jsegel!

    I'm currently on Maverick, but I've downloaded sclang from supercollider PPA and it depends on libicu42: => /usr/lib/ => /usr/lib/ => /usr/lib/

    Are you using my old PPA (~artfwo/ppa)? If so, then sorry, I've updated the post to point to supercollider "official" PPA. Hope this helps,


  52. yes, thanks. i'll reinstall now!

  53. Thanks a lot...
    I've finally successfully installed SC on my Ubuntu 10.04 !!

    Great !!

  54. ...just to say I've translate your post in French for our Wiki.


    I hope you don't mind...

    Thanks again.

  55. Of course, I don't :) Hope this little tutorial will be useful!

  56. artfwo,

    Thanks for this great post ! I first had trouble installing supercollider on my ubuntu, then -sounds stupid- but I couldn't find a tutorial that was telling how to actually start-up the whole thing !!! They all begin with some hello world code assuming that you already have a nice window where you can write your code. You provided me with the missing step !

  57. Thanks, this really helped me.
    Just one thing I still can't get any help with ctrl U in gedit. Hitting ctrl+u gives me this instead: "ERROR: Message 'escapeChar' not understood."...

  58. In the article you say "If you'd like to get some sound, make sure that JACK is started. If not, start it with qjackctl or the following command:

    jackd -d alsa"

    I found that just clicking SuperCollider>Start Server automatically started JACK (using Pure:Dyne linux). Even better!