Skip to main content

Layering visuals with SuperCollider

When I was at emfcamp last week, I saw a couple of instances of people layering up visuals with their code. Claudius Maximus had that going with his clive system, SonicPi (and Gibber??) can do it out of the box, and Shelly Knotts  had some sort of setup for (I think?) doing it completely within SuperCollider, with the cool idea of a webcam pointing down at her hands on the keyboard.

After a bit of thought, I've come up with this, just a still for now:

sclayervisuals.png

How this works: I used a $10 utility called ScreenCaptureSyphon that can amongst other things grab an application window and send it into Syphon. Then, Resolume Arena runs as a Syphon client, which lets me do almost anything including, as in the shot below, pull in the webcam and colorize. Not tried it yet, but Arena exposes its interface to OSC, so should in theory be possible to script visual changes from the SuperCollider IDE.

A reasonably concinnitous hack, if I say so myself. (Mind you, it's the first thing I've ever done with my MacBook Air that turns the fan on full blast the whole time!)

Getting my fingers burned

Sooner or later, I'm going to have to get back to the 'ol soldering iron:

JS_Synth-ttt01

I have a plan: to reconstruct the PE Minisonic you can see above, that I made while I was in school. I still have some of the boards…

Here's my screen

Show us your screens! Ok, well at last maybe I'm ready. Here's five minutes or so of me improvising in SuperCollider that's not as embarrassing as some of my other attempts:

The code is on GitHub if anyone is madly interested.

A visit to CoPeCo

In my day job in charge of the masters programmes in music at the RCS, I can't help but be interested in innovative new models of postgraduate study. So I was very happy to be able to visit Hamburg this week to observe the CoPeCo programme in action. This is a joint European masters in contemporary performance and composition, where the students study in four different institutions in Estonia, Sweden, France and Germany. The first cohort of the programme are just finishing up at the Hochschule für Musik und Theater, where I was able to attend a concert involving two of the current students, Émilie Girard-Charest (cello) and Sylvain Devaux (oboe), joined by HfMT student Fanis Gioles (percussion).

Speaking with them afterwards they were at pains to point out that this concert tonight was perhaps not typical, featuring as it did mostly precomposed music rather than devised, improvised, or collaborative work. For all that, it was a deeply engrossing evening. The first work was Mauricio Kagel's Con Voce, 'for three mute players'. The clue is in the title, with the work opening like a putative companion piece to Cage's 4'33, the three players intense, motionless and… utterly silent. For a very long time! Or, until, as Kagel's direction has it 'the listeners' level of attention is in danger of crumbling'. A piece that demands, and was given, great commitment and concentration from the players.

The next piece was the premier of a new composition by American composer Heather Stebbins, who it seems had crossed paths with the CoPeCo cohort in Tallin. A great piece, called Crow song, a duet for oboe and cello, working from tentative, unvoiced sounds through to something approaching a melodic shape, and back again. Émilie then gave a performance of Enno Poppe's work for solo cello Herz, all microtones and glisses, beautifully played with an ethereal and un-cello-like tone.

The last piece was Dmaathen by Iannis Xenakis, for oboe and percussion. I do enjoy this kind of piece, but admittedly an odd combination: I found my attention drawn more to the percussion writing than to perhaps rather dominated oboe.

I'm looking forward later this week to meeting up with Konstantina Orlandatou who coordinates the CoPeCo programme in Hamburg. Of course, this is a tragically bad time to be even thinking about European collaborations, but… it would be great if we could set up some sort of partnerships along these lines beteen the RCS and comparable institutions on the continent.

First public livecode

Last night I stumbled into my first public outing of some livecoding I've been working on in SuperCollider. The context was an improvisation night called In Tandem run by Bruce Wallace at the Academy of Music and Sound in Glasgow. I hadn't intended to play, as I really don't feel I'm ready yet, but I had my laptop and cables with me, they had a projector, so…!

I was jamming along with three other people, on bass, guitar and analog synth. It all went by in a blur, but everyone there seemed to think what I was doing was ok – mostly making grooves out of a random collection of drum samples, but running some algorithmically chosen chords as well.

The code is below: this is my screen exactly as I left it at the end of the night, mistakes and all. Although Toplap say 'show us your screens', they don't say 'show us your code', but… it seems the right thing to do.

// the end!
// they still going
// if you're curious, this is SuperCollider
// musci programming language
// writing code live is called, er, livecoding
// i'm just starting out
"/Users/jsimon/Music/SuperCollider Recordings/hitzamples/".openOS;

(
s.waitForBoot{
Pdef.all.clear; // clear things out
~hitzpath="/Users/jsimon/Music/SuperCollider Recordings/hitzamples/"; // a folder of samples
~hbufs = (~hitzpath ++ "*.aiff").pathMatch.collect({ |i| Buffer.read(s, i)}); // samples into an array of buffers
t = TempoClock(140/60).permanent_(true); // tempo 140 bpm
u = TempoClock(140/60 * 2/3).permanent_(true); // tempo 140 bpm * 2/3
SynthDef(\bf, {|out=0 buf=0 amp=0.1 freq=261.6255653006|
var sig = PlayBuf.ar(2, buf, BufRateScale.kr(buf) * freq/60.midicps, doneAction:2);
Out.ar(out, sig * amp)
}).add; // this whole chunk defines a synth patch that plays samples
};

// Pdef.all.clear;
//"/Users/jsimon/Music/SuperCollider Recordings/".openOS;
// t.sync(140/60, 16);
)

(instrument: \bf, \buf: ~hbufs.choose).play; // play an event using the synth called \bf
// pick a randoms sample from the array
(instrument: \bf, \buf: ~z).play;
~z = ~hbufs.choose;

t.sync(140/60, 32); // gradual tempo changes possible
u.sync(140/60 * 2/3, 16);
v.sync(140/60 * 5/3, 16);

Pbindef(\x, \instrument, \bf, \buf, ~hbufs.choose).play(t).quant_(4);
Pbindef(\y, \instrument, \bf, \buf, ~hbufs.choose).play(u).quant_(4);
Pbindef(\z, \instrument, \bf, \buf, ~hbufs.choose).play(v).quant_(4);
Pbindef(\z, \instrument, \bf, \buf, ~hbufs.choose).play(v).quant_(4);
~g1 = {~hbufs.choose}!16; // choose sixteen samples at random = one bar full
~g2 = {~hbufs.choose}!16;
Pbindef(\x, \buf, Pseq(~g1, inf)); // play those sixteen samples chosen
Pbindef(\x, \buf, Pseq(~g2, inf)); // different sixteen, so, a variation.
Pbindef(\x, \dur, 0.5);
~d1 = {2.rand/10}!16;
~d2 = {2.0.rand/10}!16;
Pbindef(\x, \amp, Pseq(~d1, inf));
Pbindef(\x, \amp, 0.2);
Pbindef(\x, \note, Prand((-36..0), inf));
Pbindef(\x, \note, Pseq({(-24..0).choose}!16, inf)); // pitch each sample down by random amount
Pbindef(\x, \note, nil);
Pbindef(\x).resume;
Pbindef(\x).pause;
Pbindef(\z).pause;
Pbindef(\y).resume;

// hmm. blx diminished, that's just C major!
// was using \degree instead of \note, better sounds a bit more like messiaen now :)
~c = {var x = Scale.diminished2.degrees.scramble.keep(4).sort; x.insert(1,(x.removeAt(1)-12))};
// hexMajor thing also works beautifully now!
~c = {var x = Scale.hexMajor6.degrees.scramble.keep(4).sort; x.insert(1,(x.removeAt(1)-12))};

// next question might be changing \note, \dur and \root in a coordinated way
(
Pbindef(\k, \note, Pstutter(Prand([5,7,9,11,13]*2, inf), Pfunc(~c)),
\dur, 0.5,
\root, 3, // best option for feeling of key change
\amp, Prand((2..5)/70,inf)
).play(t);
)
Pbindef(\k).pause;
Pbindef(\k).pause;


Recursive synthesis

recursivesynth.jpg

I've been working for a while with an improvising setup that uses what is sometimes jokingly called 'recursive synthesis' – that is, plugging an effect unit back in to itself and experimenting with the no-input feedback sounds.

Today I've had some success with the next step in developing this system. I've written a SuperCollider patch that allows me to gate and pitchshift the feedback sounds, so that I can begin to find a way to play them musically using a keyboard. Here's the very first run at playing this system: careful, some rather loud and uncontrolled noises here!

recursor01demoedit.mp3

In the picture, you can see the work-in-progress setup. There's a cheapo DigiTech RP55 guitar pedal feeding back through a small mixing desk. I'm using a swell pedal to contral some of the parameters of the various fx from the DigiTech, particularly sweeping the pitch of the 'whammy' and 'pitch shift' functions, set up in various presets. The mixing desk is not entirely necessary, but the tone controls are useful to have in the feedback loop.

Below is the code for the SuperCollider patch. As always, my thanks to the developers of this software, and all the help received from the community on the mailing list.

(
fork{
~velbus = Bus.control.set(1); // not using yet
s.sync;
SynthDef(\pitchin, { | midinote = 60, gate = 1, amp = 0.1 |
var in, sig, env, ratio, trans, shift, sel;
trans = midinote - 60;
in = SoundIn.ar([0,1]);
ratio = trans.midiratio;
shift = PitchShift.ar(in, pitchRatio: ratio, timeDispersion: 0.1);
sel = trans.abs > 0;
sig = Select.ar(sel, [in, shift]);
env = EnvGen.kr(Env.adsr, gate, doneAction: 2);
Out.ar(0, sig * env * amp * 37) // compensate for quiet;
}).add;
};
MIDIClient.init;
MIDIIn.connectAll;
~on.free;
~off.free;
~cc1.free;
~notes = Array.newClear(128); // array one slot per MIDI note
~on = MIDIFunc.noteOn({ |veloc, num, chan, src|
~notes[num] = Synth(\pitchin, [\midinote, num, \amp, veloc * 0.2/127]);
});
~off = MIDIFunc.noteOff({ |veloc, num, chan, src|
~notes[num].release;
});
~cc1 = MIDIFunc.cc({ |val|
val.postln;
~velbus.set(val/127*4);
}, 1, 0 ); // cc1 on channel 0 = midi channel 1, not using yet
)

Patchin' at the Hague

I've been at the Koninklijk Conservatorium in Den Haag for the last couple of days, working with a group of academics from all over Europe on the METRIC project – 'Modernizing European Higher Music Education through Improvisation'. (If anyone can tell me in which language that acronym works, I'd love to know!)

While I'm here, I've been amusing myself with some work on a simple SuperCollider patch to pitchshift live audio, that I intend to use as part of my own improvisational practice. Particularly tickled to be able to say in future that I 'worked on this patch at the Institute of Sonology in The Hague', which is strictly speaking… more or less true!

Also brings fond memories of another piece of software associated with this institution, ACToolbox, that I used quite extensively in the past, although not so much now.

Let's hear it for koncon!

Here's some test code, part of a larger project:

// Institute of Sonology, Den Haag, 18 Mar 2016 :)
(
SynthDef(\pitchin, { | trans = 0, gate = 1 |
var sig, env, ratio;
sig = SoundIn.ar([0,1]);
ratio = trans.midiratio;
sig = PitchShift.ar(sig, pitchRatio: ratio, timeDispersion: 0.1);
env = EnvGen.kr(Env.adsr, gate, doneAction: 2);
Out.ar(0, sig * env);
}).add;
)
x = Synth(\pitchin);
x.set(\trans, 12); // can sound a bit comby, try timeDispersion about half grainsize
x.set(\trans, -12);
x.set(\trans, 7);
x.set(\trans, -7);
x.free;

Gamelan Composers Forum

Yesterday I was in London with the Gamelan Composer's Forum, an occasional collective brought together by Aris Daryono and Rob Campion to share approaches to writing for the gamelan. This particular event the series is entitled 'The Intimate Gamelan', and features three pieces written for a gadhon-size ensemble, performing in a private house in South London.

There were three new pieces. 'Sang Empu' ('The Maestro') was Aris' piece scored for cello and ciblon, the cello part being taken by Alice Jones. Aris explains that this piece draws both on the cello tradition within kroncong, where the cello imitates the kendhang, and on the ciblon drummming for palaran.

Rob contributed another piece involving Alice on the cello, 'New Moon'. This featured Rob playing the slenthem with two beaters, like a giant gender: I rather like imagining the cello in this piece as a giant rebab!

My own piece was a one-off assemblage of two of my 'openings', flexible bits of bits of material that I reuse in different ways for different performing occasions. The first part was based on an idea entitled 'fibblestix', an accellerating series of percussive clicks that eventually prompt a response form the gender. The second part of 'Two Openings' – as the overall piece is called – is 'Adrift & Afloat' adapted for one pelog and one slendro gender. I'm very happy indeed with the way Rob and Aris approached this piece, very thoroughly prepared, and sounding very convincing indeed the intimate setting of a private house.

A fascinating evening: I'm glad I made the effort to get down to London to take part.

Ball of Sardines @ Red Note Noisy Nights

excerpt from score

Just for fun, I did an arrangement of Ball of Sardines for one of Red Note's ‘Noisy Nights’: flute violin, trombone, and the conductor playing kethuk. (This is instead of the piece I was going to write, a masterpiece of algorithmic pointilism to be entitled ‘Moment of Indecision’. I may finish that one day…)

Monday 1 February 2000-2200 – Free Summerhall 1 Summerhall Place Edinburgh - EH9 1QH

Working on new music for gamelan

Over the winter break, I've been working on some new music for gamelan. Following on from Naga Mas' rather spectacular success with our gamelan-in-outer-space piece Gamelan Untethered, we have plans to do something along the same lines, but this time on an underwater theme. Below is a midi demo of something I'm working on for the group: a sort of sampak/kebyar fusion piece, pulling together some of the livelier ideas from the Javanese traditions with a Balinese-inspired melody.

This may prove a little tricky to play!