sc multiple apps

during a recent gig i suddenly felt a need to crossfade between two songs/patches (strange as it seems). as i'd coded my music using RedMst and it in turn makes heavy use of class methods, starting up a new song would disrupt the current music playing (tempo, current index, etc). i also had some master effects running on bus 0 and 1 (ReplaceOut) that belonged to a particular song and i didn't want those for the new one.

so how to isolate patches? i got the idea of running two copies of the supercollider application at the same time. they'd be identical, use the same soundcard and share class library. having two apps running would also be good for safety reasons. if one crashed i could keep on playing with the other. it turned out to be quite easy. the trick is to use the internal server and find a way to visually tell the two applications apart.
dan stowell helped me by implementing and i got some great tips from cylob. he used a similar setup for his live performances. here's my take on it... (you'll need a recent version of supercollider (>30oct '08)

1. put the code below into your startup.rtf file. it'll make the secondary app green and shift windows to the right - this only so one can tell them apart.
2. go to supercollider application folder and duplicate the program file (cmd+d). rename the copy "SuperCollider (green)". remember to duplicate again when you've updated your main sc app.
3. important: from now on use internal as the default server in your code. localhost will crosstalk when running multiple apps.

so with a simple duplicate command and minimal change to sc itself (just for cosmetic difference), i can now crossfade my songs.

//put this in startup.rtf...

//--detect secondary application and colour it green
var p, l;
~green= false;
p= Pipe("ps -xw | grep 'SuperCollider (green)' | grep -v grep | awk '{print $1}'", "r");
l= p.getLine;
if(l.notNil and:{}, {~green= true});

if(~green.not, {        //for main app (red)
        GUI.skins.put(\redFrik, (
                selection: Color.grey,
                unfocus: 0.9,
                fontSpecs: ["Monaco", 9],
                offset: Point(0, 0)
}, {                    //for secondary app (green)
        GUI.skins.put(\redFrik, (
                selection: Color.grey,
                unfocus: 0.9,
                fontSpecs: ["Monaco", 9],
                offset: Point(455, 0)
        Document.listener.background_(GUI.skins.redFrik.background.blend(Color.grey(0.9), 0.9));
        Document.initAction_{|doc| doc.background_(GUI.skins.redFrik.background.blend(Color.grey(0.9), 0.9))};{|x|
                x.window.bounds= x.window.bounds.moveBy(GUI.skins.redFrik.offset.x, 0);
                x.window.view.background_(GUI.skins.redFrik.background.blend(Color.grey(0.9), 0.9));

Document.listener.bounds_(Rect(GUI.skins.redFrik.offset.x, GUI.window.screenBounds.height-580, 450, 580));


RedMst, RedTrk, RedTrk2 and RedSeq are a set of supercollider classes that i now finally cleaned up and released. i wrote them about a year ago and have been using them for live performances since then. they function as sort of a timeline and the basic idea is to sequence code in a very simple way.
the master keeps track of when some tracks should play and then switches them on/off with .play and .stop at the right time (next quant beat, default= 4). a track can be any code that responds to these two messages (pbind, bbcut2, pdef, routines, etc).

redMst is distributed as a quark. see Quarks helpfile for more info on how to install.


and then recompile sc and open the RedMst helpfile.

screenshot of the RedMstGUI3 example...

but RedMst can of course also be used totally without any gui.

supercollider study group (scsg) in japan

tn8 and i started weekly meetings for people interested in interactive sound programming using supercollider. here is our wiki with example code and discussion forum. much of it is in japanese but the example files should have comments in english.
we meet every friday at 17.00 for a ~2h session. 2nd floor, new building, iamas, ogaki. open for everyone.

also attached the files below...

Package icon scsg.zip38.13 KB

MaxPat - max patch parser, converter, manipulator, generator

i wrote a max5 to max4 patch converter in supercollider. the reason was to get more people to install sc. so this is software with a hidden agenda.
download it here. see the readme for installation instructions and info on how the conversion works.
it can also be used to generate, examine, manipulate and process max5 patches in different ways. below are some screenshots of patches from the max-examples folder that i manipulated using this class. they might look strange but are fully functional. i just did things like add curly segments to all the patchlines.

my plugins available as windows binaries

in june i compiled my tiny collection of plugins for psycollider. (RedPhasor, RedNoise, Bit, Slub, Atari2600, Pokey etc.) they are available as separate downloads here
extract and put in your userExtensionDir, recompile. now the RedXM and RedMOD classes also works as they depend on RedPhasor.

and for reference here's my way of compiling ugens on xp...

1. install mingw (automated installer 5.1.4). add g++ support.
2. install pthread (2.8.0). put it C:\pthreads-w32 or modify the path below.
3. download sc source and put it C:\SuperCollider-Source or modify the path below.
4. open command promt and cd to your plugin directory.
5. g++ -shared -Wno-deprecated -O3 -Wno-unknown-pragmas -DSC_WIN32 -D__GCC__ -D_REENTRANT -DNDEBUG -DSC_MEMORY_ALIGNMENT=1 -IC: \SuperCollider-Source\Headers\plugin_interface -IC:\SuperCollider-Source\Headers\common -IC:\SuperCollider-Source\Headers\server -IC:
\SuperCollider-Source\libsndfile -IC:\pthreads-w32 C:\SuperCollider-Source\windows\PlugIns\ExportHelper.cpp -o RedPhasor.scx RedPhasor.cpp

n fm7 patches

about letting the computer generate sc code automatically... stefan kersten made a very nice plugin for supercollider. it's called FM7 and implements a 6x6 phase modulation oscillator matrix. while trying it out, i wrote some code (pasted in below) that automatically generates parameters for it. so every 8th bar it'll construct a new patch around the fm7. in these patches the fm7 parameters are ugens with random frequency, phase, range and offset.
at times, i start the generator, lean back and listen. when something good catches my ears, i copy the generated code from the post window. here are some ok ones i've collected... _n_fm7patches and below are mp3 excerpts of the same. but the best ones i of course keep to myself.
by randomly generating patches and synths like this i loose a lot of control and time listening to all the generated patches. most are crap sounding. but on the other hand the blind randomness sometimes comes up with with so strange rhythms and sounds that i never would've been able to think of myself. and the time lost could be minimised using for instance genetic algorithms or other types of searches in this huge parameter space.

get FM7 by installing SC3-plugins


//--more repetitive 2ch instant clicks 'n cuts with code generation /f0
//when you hear something you like, you can save it by copy&paste from the post window
        var syn, time= 16;              //allow each patch to run for 16sec / 8bars{|i|
                ("\n//fm7 patch"+i+"generated on"+Date.localtime).post;
                syn= ("
                        var x= #"
                        var y= #"
                                var ctls= x.collect{|a| a.collect{|b|*b)}};
                                var mods= y.collect{|a| a.collect{|b|*b)}};
                                var chans= #[0, 1];
                      , mods).slice(chans)*0.5;


Subscribe to RSS - supercollider