Wednesday, May 21, 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.

Friday, May 2, 2008

aoTuV beta5.5

Decided to encode some recently purchased CDs at last, but due to a complete Hardy reinstall last week, I've had to go for some fresh aoTuV vorbis sources and to my suprise there has been a new beta available for quite some time already!

I don't think this version is substantially different from beta5 (aka 4.51), I can't hear any difference between the encoded file and the original at q6 (which is my default quality setting) and both versions produce seemingly identical output to me.

Nevertheless, I've decided to stick with beta5.5 just because it's the latest :) But I couldn't resist building a patched Ubuntu package besides a static oggenc binary, which I've always compiled for this purposes before (simply to keep the system libraries intact).

Just in case anyone's interested in trying beta5.5, the updated libvorbis binaries can be found in my PPA, but the statically linked oggenc 1.2.0 binary is available as well.