SuperCollider 3.5 Release!

This is the post from the SuperCollider mailing list.

———————————————————————————————-

finally 3.5 is out! it contains many new features and bugfixes. the highlights
are new help system, a new cross-platform gui and a new multiprocessor-aware
audio-synthesis server. for details, please consult the `News in 3.5′ section
of the new help system, which can be found online at:
http://doc.sccode.org/Guides/News-3_5.html

source tarballs:
https://sourceforge.net/projects/supercollider/files/Source/3.5.0/SuperCollider-3.5.0-Source.tar.bz2
https://sourceforge.net/projects/supercollider/files/Source/3.5.0/SuperCollider-3.5.0-Source-linux.tar.bz2

osx installer:
http://sourceforge.net/projects/supercollider/files/Mac%20OS%20X/3.5.0/SuperCollider-3.5.0-OSX-x86.dmg

windows installer (should be used with gedit [1]):
http://sourceforge.net/projects/supercollider/files/Windows/3.5.0/SuperCollider-3.5.0-win32.exe/download

thanks a lot to everyone that has been involved in this release!

cheers, tim

SuperCollider: Long code to Short Using Array

I know that there are many SuperCollider gurus out there, so that many people could have their own ways to make their code ‘pretty.’
But I would like to share what I have done regarding ‘Removing some repetition and making it simple.’

Here is the example.

This happens quite often on GUI making. I would like to make several sliders:

/////////////////////Sliders///////////////////////////////
slider1 = EZSlider(w, 350 @ 20, "conVar", cs.conVar,
 { |slider| if (b.notNil)
 { b.set(\conVar, slider.value) } });
slider2 = EZSlider(w, 350 @ 20, "LPF", buf1cs.lpf,
 { |slider| if (~buff1.notNil)
 { ~buff1.set(\freq, slider.value) } });
slider3 = EZSlider(w, 350 @ 20, "amp1", buf1cs.amp,
 { |slider| if (~buff1.notNil)
 { ~buff1.set(\amp, slider.value) } });
slider4 = EZSlider(w, 350 @ 20, "amp2", buf2cs.amp,
 { |slider| if (~buff2.notNil)
 { ~buff2.set(\amp, slider.value) } });
slider5 = EZSlider(w, 350 @ 20, "amp3", buf3cs.amp,
 { |slider| if (~buff3.notNil)
 { ~buff3.set(\amp, slider.value) } });
slider6 = EZSlider(w, 350 @ 20, "amp4", buf4cs.amp,
 { |slider| if (~buff4.notNil)
 { ~buff4.set(\amp, slider.value) } });

Here, there are many parameters that are repeated, and many are different.

So that I bound the same things together, and make arrays for the differences.

/////////////////////Sliders///////////////////////////////
slider = Array.new(6);
sliderItem=["conVar","LPF","amp1","amp2","amp3","amp4"];
sliderCs = [cs.conVar,buf1cs.lpf,buf1cs.amp,buf2cs.amp,buf3cs.amp,buf4cs.amp];
synthVar = [b, ~buff1, ~buff1, ~buff2, ~buff3, ~buff4];
sliderAction = [\conVar,\freq,\amp,\amp,\amp,\amp];
sliderItem.do({
 arg item, i;
 slider.add('item'++i);
 slider[i]=EZSlider(w, 350 @ 20, item, sliderCs[i],
 { |slid|
 if (synthVar[i].notNil)
 { synthVar[i].set(sliderAction[i], slid.value) }
 });
});

One might argue that the number of lines are not so different. But thinking of creating 20 different sliders, then definitely, the line of the later example will stays the same. This will save quite amount of codes, at the same time it is more convenient when one needs to fix and add a part of the code.

More specific explanations here:

I make an array for 6 sliders without giving names to each slider, but just creating a space for each.

slider = Array.new(6);

Here are the different paramaters like the name of arguments and control specs, and synthname for each slider.

sliderItem=["conVar","LPF","amp1","amp2","amp3","amp4"];
sliderCs = [cs.conVar,buf1cs.lpf,buf1cs.amp,buf2cs.amp,buf3cs.amp,buf4cs.amp];
synthVar = [b, ~buff1, ~buff1, ~buff2, ~buff3, ~buff4];
sliderAction = [\conVar,\freq,\amp,\amp,\amp,\amp];

Here I use ‘do’ . The argument ‘item’ will be ‘slideritem’ in order, and ‘i’ will simply count the number of the items.

sliderItem.do({
 arg item, i;
 slider.add('item'++i);
 slider[i]=EZSlider(w, 350 @ 20, item, sliderCs[i],
 { |slid|
 if (synthVar[i].notNil)
 { synthVar[i].set(sliderAction[i], slid.value) }
 });
});

I have given names to the slider by doing

slider.add('item'++i);

The reason is to connect with midi controller :
For instance,

ccNum = [2, 3, 4, 5, 6, 8];//this is the number of midi fader on midi controllder
CCResponder({ |port, chan, num, val|
 ccNum.do({
 arg item, i;
 if (num ==item.value)
 { {slider[i].value = slider[i].controlSpec.map(val/127.0)}.defer;
 slider[i].doAction}; // defer makes it move
 });
});

Jack to work with SuperCollider in Linux

I am still quite new to Linux in general. I am learning a lot by just trying to use it, and trying not to move back to OSX just to do a simple task. So that this post might be for a person like me, who has struggled a lot on this ‘new’ way of patching sound in and out and configuring in a right way.
I have used Jack before in OSX when I was trying to do a virtual multichannel test, but there was a graphical interface, not at all complicated. There is also ‘system preference’ that OSX offers. When I change the soundcards, or using different inputs/outputs, I didn’t need to do much. But here, it might be a simple thing, but I was in panic.
So that I would like to share my experience if this can help anyone who is like me.

I have two different versions of linux that I am using in different laptop. 11.04/11.10.

Here I am focusing on 11.04, because 11.10 had less issues.

Jack versions and library installed : jackd, libjack-jackd2-dev, jackd2-firewire, jackd2, libjack-jack2-0, libasound2-plugins

First of all, I was at the first moment trying to use ‘qjackctl‘ that offers graphical user interface. But weiredly, the value that I have changed was not applied to the result.

Screenshot of qjackctl setup window

The default sample rate was set to 48000, and I wanted to change it into 44100. Even though I was doing it, it didn’t change.

Asking some people around, I found that pulsa audio can be the cause of issue, so I removed it and tried to use only ‘alsa.’

Jack setup

When I run scvim, I use a bash script in order to reduce any possible complications such as already-running-sclang. I saved it as ‘iscvim’ and fixed chmod to an exacutable, and put it into a path (i.g. /usr/local/bin.).

Here I include jack setup as well.

#!/bin/bash
cd ~
killall jackd
killall sclang
killall scsynth
killall scvim
killall sclangpipe_app
jackd -t 500 -d alsa -d hw:0 -r 44100 -p 1024 -s -S &
sleep 1
scvim

Here I set to use alsa as the driver, and device as hw:0, sample rate: 44100, period 1024, softmode and the last of -S is to cofigure card for 16bit. This configuration can differ from soundcard. I tried to use 32 bit, but my sound card only supports 32 bit-float. But this created problem with sc3, (creating distortion) and I assume that this is because of -float- (it could be supposed to be integer).

Check something like this when you run jack,

ALSA: final selected sample format for capture: 32bit float little-endian

or

ALSA: final selected sample format for capture: 16bit little-endian

In order to know what card you have;

cat /proc/asound/cards

In order to know what other configuration will be possible with your soundcard, use ‘jack_control,’ which shows you all possible options for your setup, and not difficult to use.

For Realtime Scheduling

This is followed by what ‘jack’ website suggests, and it works very well. (http://jackaudio.org/linux_rt_config)

Open /etc/security/limits.d/audio.conf

Then fix as below.

# Provided by the jackd package.

#
# Changes to this file will be preserved.
#
# If you want to enable/disable realtime permissions, run
#
# dpkg-reconfigure -p high jackd
@audio - rtprio 95
@audio - memlock unlimited
#@audio - nice -19

So far, no issue when I am using SCVim, and I run Jack when I need to use it.  Hope this helps.