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 alsaAfter 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:
{SinOsc.ar}.play;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 { RLPF.ar( Saw.ar(55), LFNoise1.kr([5, 5], mul: 440, add: 880), 0.1, mul: 0.25 ) }.play; )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.
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.
ReplyDeleteHi, Jaime! You can install SwingOSC very quickly as well by copying the contents of SuperCollider/SCClassLibrary directory from SwingOSC-0.60.zip to:
ReplyDelete/usr/share/SuperCollider/Extensions
(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 :)
Hi artfwo,
ReplyDeleteI'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.
-Miguel
Miguel, the startup file for SuperCollider would be ~/.sclang.sc. Try placing the following code inside the startup file:
ReplyDeleteSwingOSC.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 :)
-Artem.
Thanks for this short and sweet howto and your time saver packages!
ReplyDeleteI know this is an old post, but I really appreciate your work in making these packages available along with some helpful directions. Thank you!
ReplyDeleteHI,
ReplyDeleteI've been using 7:10 - I have an older computer (Omnibook XE3). Is there a 7:10 workaround for the dependencies?
thanks
No, there's no version for 7.10, but I'm going to try and build this one for you as well, stay tuned!
ReplyDeleteThankz lot for u'r grt info
ReplyDeleteReally it ws very much useful for me
A little update on this. The packages are now built on an almost weekly basis for Jaunty, Intrepid and Hardy.
ReplyDeleteUnfortunately, 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.
Thanks a lot for this tutorial! Everything working in Ubuntu 8.10. Been using MAX and PD, but this SC is amaising...
ReplyDeleteI 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,
Lorenzo
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??
ReplyDeleteDo 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?
ReplyDeleteneither 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
ReplyDeleteCould you please E-mail the log messages to me, so that I could check what's wrong for you? (artfwo KLMRF gmail DOT com)
ReplyDeleteJust a public 'thank you' to Artem for helpingme solve the above problem
ReplyDeletehi artfwo,
ReplyDeleteunfortunately i have not been able to install swingosc. when starting gedit in supercollider mode, i get the following output:
init_OSC
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/extCocoaCompat.sc'
...and a couple of additional error messages. could you please tell me what is wrong?
That's okay, those error messages can simply be ignored, and swingOSC will work.
ReplyDeletethanks for this post!
ReplyDelete/r
It doesn't look like supercollider is installable on Intrepid 64-bit...
ReplyDeleteAny ideas?
Well, the only non-dev package, installable on amd64, is the server (deb here). Is it uninstallable directly for you as well?
ReplyDeleteOh, and would you provide more details (error messages, if any)? Thanks.
Hi,
ReplyDeletesorry 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";
Marc, have you copied the SwingOSC classes (*.sc) into ~/share/SuperCollider/Extensions/SwingOSC?
ReplyDeleteI have the classes in the following directories:
~/share/SuperCollider/Extensions/SwingOSC/
~/share/SuperCollider/Extensions/SwingOSC/SwingGUI.sc
etc...
Hey thank you for your great work!!
ReplyDeleteEverything is running fine, except one thing:
I'm a beginner as well, and I'm wondering if the missing classes (e.g. SCDragView.sc 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?
@Marc
... and perhaps you should enter the correct path instead of "/path/to/swingosc/" (if that's the original error message you get).
Thanx
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.
ReplyDeleteI'm unable to test it myself right now (no Java), but the interpreter loads without an error. Woot!!
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...
ReplyDeleteSCDragView works for me right now. If you're using Ubuntu packages from PPA, please try upgrading to 3.3~svn8801 first...
ReplyDeleteThen, 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 SwingOSC-0.61RC_SVN156-090130.zip
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
Hi,
ReplyDeleteis 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.
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.
ReplyDeleteSo, 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.
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
ReplyDeleteThanks much for these directions. Worked like a charm for SC. (Though I ended up using sc-emacs instead of sc-gedit.)
ReplyDeleteHere's what I did to make SwingOSC work on a Ubuntu install:
1) Fetch swingOSC: http://sourceforge.net/project/showfiles.php?group_id=155586
2) unzip SwingOSC-0.61RC_SVN156-090130.zip
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:
SwingOSC.program="/usr/share/SuperCollider/Extensions/SwingOSC/SwingOSC.jar";
SwingOSC.default.boot;
GUI.swing;
And it works! Woot.
hi!
ReplyDeleteam on intrepid and did the:
apt-get install supercollider
and
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:
scvim
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
tia
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:
ReplyDeletevim-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.
my english reading is not good enough but this is what you mean in the last sentence?
ReplyDelete~/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:
vim-addon-manager
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 http://archive.ubuntu.com 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.
Oops, sorry! My mistake... Please try to run "vim-addons install supercollider" instead. This have been tested to work properly for sure.
ReplyDeleteyes!! it came out at last!
ReplyDeletei 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!
so i added the keys, and updated my sources.list.
ReplyDeleteand 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 http://mirrors.kernel.org intrepid Release.gpg
Ign http://mirrors.kernel.org intrepid/main Translation-en_US
Ign http://mirrors.kernel.org intrepid/universe Translation-en_US
Hit http://mirrors.kernel.org intrepid Release
Hit http://mirrors.kernel.org intrepid/main Packages
Hit http://mirrors.kernel.org intrepid/universe Packages
Hit http://archive.canonical.com intrepid Release.gpg
Ign http://archive.canonical.com intrepid/partner Translation-en_US
Hit http://security.ubuntu.com intrepid-security Release.gpg
Ign http://security.ubuntu.com intrepid-security/main Translation-en_US
Ign http://security.ubuntu.com intrepid-security/restricted Translation-en_US
Get:1 http://ppa.launchpad.net intrepid Release.gpg [307B]
Ign http://ppa.launchpad.net intrepid/main Translation-en_US
Hit http://packages.medibuntu.org intrepid Release.gpg
Ign http://packages.medibuntu.org intrepid/free Translation-en_US
Hit http://us.archive.ubuntu.com intrepid Release.gpg
Ign http://us.archive.ubuntu.com intrepid/main Translation-en_US
Hit http://archive.canonical.com intrepid Release
Ign http://security.ubuntu.com intrepid-security/universe Translation-en_US
Ign http://security.ubuntu.com intrepid-security/multiverse Translation-en_US
Hit http://security.ubuntu.com intrepid-security Release
Get:2 http://ppa.launchpad.net intrepid Release [46.7kB]
Ign http://packages.medibuntu.org intrepid/non-free Translation-en_US
Hit http://packages.medibuntu.org intrepid Release
Ign http://us.archive.ubuntu.com intrepid/restricted Translation-en_US
Ign http://us.archive.ubuntu.com intrepid/universe Translation-en_US
Ign http://us.archive.ubuntu.com intrepid/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com intrepid-updates Release.gpg
Ign http://us.archive.ubuntu.com intrepid-updates/main Translation-en_US
Ign http://us.archive.ubuntu.com intrepid-updates/restricted Translation-en_US
Hit http://archive.canonical.com intrepid/partner Packages
Ign http://us.archive.ubuntu.com intrepid-updates/universe Translation-en_US
Ign http://us.archive.ubuntu.com intrepid-updates/multiverse Translation-en_US
Hit http://us.archive.ubuntu.com intrepid Release
Ign http://ppa.launchpad.net intrepid/main Packages
Hit http://security.ubuntu.com intrepid-security/main Packages
Hit http://packages.medibuntu.org intrepid/free Packages
Hit http://archive.canonical.com intrepid/partner Sources
Hit http://us.archive.ubuntu.com intrepid-updates Release
Ign http://ppa.launchpad.net intrepid/main Sources
Hit http://security.ubuntu.com intrepid-security/restricted Packages
Hit http://security.ubuntu.com intrepid-security/main Sources
Hit http://security.ubuntu.com intrepid-security/restricted Sources
Hit http://security.ubuntu.com intrepid-security/universe Packages
Hit http://packages.medibuntu.org intrepid/non-free Packages
Hit http://us.archive.ubuntu.com intrepid/main Packages
Hit http://us.archive.ubuntu.com intrepid/restricted Packages
Hit http://us.archive.ubuntu.com intrepid/main Sources
Hit http://us.archive.ubuntu.com intrepid/restricted Sources
Hit http://us.archive.ubuntu.com intrepid/universe Packages
Hit http://ppa.launchpad.net intrepid/main Packages
Hit http://security.ubuntu.com intrepid-security/universe Sources
Hit http://security.ubuntu.com intrepid-security/multiverse Packages
Hit http://security.ubuntu.com intrepid-security/multiverse Sources
Hit http://us.archive.ubuntu.com intrepid/universe Sources
Hit http://us.archive.ubuntu.com intrepid/multiverse Packages
Hit http://us.archive.ubuntu.com intrepid/multiverse Sources
Hit http://us.archive.ubuntu.com intrepid-updates/main Packages
Hit http://us.archive.ubuntu.com intrepid-updates/restricted Packages
Hit http://us.archive.ubuntu.com intrepid-updates/main Sources
Hit http://us.archive.ubuntu.com intrepid-updates/restricted Sources
Hit http://ppa.launchpad.net intrepid/main Sources
Hit http://us.archive.ubuntu.com intrepid-updates/universe Packages
Hit http://us.archive.ubuntu.com intrepid-updates/universe Sources
Hit http://us.archive.ubuntu.com intrepid-updates/multiverse Packages
Hit http://us.archive.ubuntu.com 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
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:
ReplyDeletedeb http://ppa.launchpad.net/artfwo/ppa/ubuntu 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).
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. :(
ReplyDeleteYes, it's very easy. See the WiiMote helpfile for an example (worked for me without problems).
ReplyDeletetoday i wanted to view the help in scim
ReplyDeleteso i did :SChelp as it says so when sc gets booted
buh
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?
sorry i was so stupid...
ReplyDeletei just had to run SCVim.updateHelpCache
in the SCVim window that i opened ;D
thanks for this post!
ReplyDeleteI can't seem to get the install to work on jaunty. I've added:
ReplyDeletedeb http://ppa.launchpad.net/artfwo/ppa/ubuntu jaunty main
deb-src http://ppa.launchpad.net/artfwo/ppa/ubuntu 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?
tacitdynamite, that is strange, because Jaunty packages are even built for amd64 now and they're residing in the pool.
ReplyDeleteCould you try to run "sudo apt-get update" separately and email the output to me? (together with your sources.list)
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.
ReplyDeleteThanks 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 ?
ReplyDeleteIf you mean the startup file for sclang, that would be ".sclang.sc", which must be stored in your home directory. Hope that helps!
ReplyDeleteIs there an easy way to install sced on karmic koala? I'm lost.
ReplyDeleteKarmic packages are currently residing in this PPA:
ReplyDeletehttps://launchpad.net/~artfwo/+archive/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.
having an issue in ubuntu studio 10.04, sclang error: can't find libicui18n.so38
ReplyDeletei believe so42 is installed...
Hi, jsegel!
ReplyDeleteI'm currently on Maverick, but I've downloaded sclang from supercollider PPA and it depends on libicu42:
libicui18n.so.42 => /usr/lib/libicui18n.so.42
libicuuc.so.42 => /usr/lib/libicuuc.so.42
libicudata.so.42 => /usr/lib/libicudata.so.42
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,
--Artem
yes, thanks. i'll reinstall now!
ReplyDeleteThanks a lot...
ReplyDeleteI've finally successfully installed SC on my Ubuntu 10.04 !!
Great !!
...just to say I've translate your post in French for our Wiki.
ReplyDelete-> http://wiki.labomedia.org/index.php/SuperCollider
I hope you don't mind...
Thanks again.
Of course, I don't :) Hope this little tutorial will be useful!
ReplyDeleteartfwo,
ReplyDeleteThanks 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 !
Thanks, this really helped me.
ReplyDeleteJust 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."...
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:
ReplyDeletejackd -d alsa"
I found that just clicking SuperCollider>Start Server automatically started JACK (using Pure:Dyne linux). Even better!