Update on ‘Why Scotland, Why East Kilbride’

Exactly a month to go now to ‘Why Scotland, Why East Kilbride’, my Cryptic Nights show at the CCA. Today I met with Steve Ford, who, as well as playing bass is going to be doing the live audio chemistry. Here’s an example of the kind of thing we won’t be doing:
Preparation of SO3

Somehow that one never got through the risk assessment :)

First performance of RITE for four pianos and electronics

Rather cool to be sharing the bill with ‘Six Pianos’ tomorrow night. Call me a boring old minimalist, but I still love that piece.

Here’s the lineup:

Multiple Piano Extravaganza
7.30pm Stevenson Hall, Royal Conservatoire of Scotland
£9.50/£6.50

Steve Reich Six pianos
Jonathan Plowright, Alina Horvath, Maraike Breuning, Monika Palsauskaite, Catherine Clark, Donal McHugh

Vera Stanojevic Droplets of Dew for 4 pianos and electronics (World Premiere)
Sinae Lee, Graeme McNaught, Fali Pavri and Aaron Shorr

Free improvisations for multiple pianos, electronics and voice
Anto Pett, Anne Liis Poll, Alistair MacDonald and Aaron Shorr

J Simon van der Walt RITE for Four Pianos and Electronics (World Premiere)
Sinae Lee, Fionnuala Ward, Beth Jerem, Marlon Bordas Gonzalez

More work in progress on RITE – pics

rite-reh02 script

From the second rehearsal for RITE: pianists Sinae Lee, Fionnuala Ward, Beth Jerem and Marlon Bordas Gonzalez trying out the fx units, and my script for the piece so far.

RITE for for four performers, four pianos, and four effects units: Friday March 8, 1930, Royal Conservatoire of Scotland. Also featuring works by Steve Reich and Vera Stanojevic, improvisations by Alistair MacDonald, Anto Pett, and Anne-Liis Poll.

Quartz Composer video sampler for WSWEK

Here’s a screenshot of something I’ve been working on today for ‘Why Scotland, Why East Kilbride’:

wswek-samp01

Regular readers of this blog (ahem) will recall that this all started with a piece of music I heard in a dream, for a double rock band plus a big squad of french horns. Well, the double rock band is doable, but the french horns were going to be impractical for the gig.

So, I’m building a sort of video sampler. There will be video clips of each of the four chords the horns play, with four different variations of each chord. Midi notes will then be used to trigger a clip of the correct chord. This would have been easy to do using Jitter in Max… so I had to do it the hard way and try to build it in Quartz Composer!

I’m getting there, ish. The visual tools in QC are amazing, but the program structuring and logic is kind of Turing-machine basic. Like, to combine four numbers I had to use a combination of three OR gates, and to build a toggle switch it’s a counter then take the count modulo 2. And it’s crashy and buggy, and the documentation is rudimentary. And I’m going to have to edit the video super carefully, if the clips aren’t exactly 2400ms long then my programming will break.

But… it might just work.

First rehearsal for ‘Why Scotland, Why East Kilbride’

We’ve just had the first rehearsal for ‘Why Scotland, Why East Kilbride’, which is a new piece I’m putting together for Cryptic Nights, 4 & 5 July of this year. This piece is a fantasy: an reimagination of my own East Kilbride childhood, as expressed through the medium of my alter ego Edward ‘Teddy’ Edwards, unsung hero of early British electronica.

The musical starting point for this piece was a dream I had, where I heard a fragment of music for what seemed to be a double rock band plus an orchestral horn section. Tonight was the first jam session with the band I’ve put together. This is made up of people who don’t really do this sort of thing! I’ve got two ex students of mine, Aimée Laws and Nikki Donaldson (from Edinburgh College and the Conservatoire respectively) on drums and keyboards. My second drummer is legendary percussionst/composer Steve Forman, a colleague of mine from the Conservatoire, while on bass I’ve got Steve Ford, who I’m also collaborating with on a sci-art sonifiation project. Rounding out tonights lineup was Bill Whitmer, aka williwaw, a great ukulele player, whose solo improvisations to film loops is part of my inspiration for this project.

I played guitar for tonight, although in the final thing I thing I’ll probably be swapping between elecronic noise-makers and a video sampler, which I’m going to use to represent the horn players. So, we had four chords and… we jammed.

Interesting. When I was a teenager, the idea that one day I would play rhythm guitar in a space rock band seemed like some sort of unattainable dream. Now it seems all I need to do is book a rehearsal room and go for it. Musically, it’s a ridiculously easy thing to do. However, I do now have some work to do to structure the whole show: in the end, 25 minutes of semi-inept rock jamming just sounds like, er, 25 minutes of semi-inept rock jamming!

I have some ideas. I’ve tried putting the recording of our best jam together with the video, and it’s got something going for it. Not going to make that public for now, would spoil the surprise…

Work in progress – RITE

I’m working on three pieces of music at the moment. Well, that is, I’m supposed to be working on three pieces of music at the moment – today I actually managed to get some work done on two of them, at any rate.

The big project I have on the go is Why Scotland, Why East Kilbride, a music theatre piece for Cryptic Nights, CCA Glasgow 4 & 5 July next year. It’s for double rock band with video projection, including, I’ve just decided today, a ‘digital video mellotron’, which I’m going to use to deliver the 16 French horn parts needed for the piece. However, the work I’ve done on that piece today is boring and administrative…

More interestingly, I’ve turned this evening to a new work in progress called RITE, for four performers, four pianos, and four effects units. The centenary of the Rite of Spring is coming up next year, and I’ve been invited to write a piece, hence the deliberately-dodgy all caps title. To quote my current draft of the programme note:

The title of the piece is an acronym: it might also be spelled R.I.T.E. Perhaps it stands for this:

Recursive Invariant Transform (Electronic) = RITE

Or possibly:

RITE is terrible ecronym.

The four effects units are going to be used as feeding-back no-input noise-makers, operated by the pianists themselves. I’ve spent some happy hours surfing eBay for obsolete fx units and mixers: my latest purchase is a lovely old ART FXR Elite II which you can hear on the clip below. For the pianistic material, I’m mulling over those little bits of the piece which have always stuck in my ear, and kind of rewriting them as if from memory. Today I’ve been reworking the little scale for two flutes at the very end of the piece, just eighteen notes, which have already generated several minutes of material.

This clip is a kind of meditative recomposition of the initial two chords from the ‘Mystic Circles of the Young Girls’, combined with recursive fx stuff:

rite_sketch_01.mp3

Sonifying IR spectroscopy data – rhythm

For today’s exciting episode, I’m using the simplified spectrum data from glycine to generate a sound, and then looping round the same data to play the sound in a kind of ‘rhythm’:

(
~name = "glycine";
~path = Document.current.dir.asString++"/"++ ~name ++".csv";
f = CSVFileReader.readInterpret(~path);

f = ((f.flop[1] * -1) + 1).normalize;

f = (f*100).asInteger;
f = f.differentiate.removeEvery([0]).integrate;
f = f/100;

~peaksIndices = f.differentiate.sign.findAll([1,-1]);

g = Array.fill(f.size, 0);

~peaksIndices.do { |i| g[i] = f[i] }; // Daniel's line

~amps = g;

// [f,~amps].plot(~name, Rect(840,0,600,450));

~freqs = (36..128).resamp1(f.size).midicps;

SynthDef(\glycine, { | gate=1, amp |
	var env, sig;
	sig = Klank.ar(`[~freqs, ~amps, nil], PinkNoise.ar(amp/100));
	env = EnvGen.kr(Env.perc, gate, doneAction: 2);
	Out.ar(0, Pan2.ar(sig, 0, env))
}).add;

Pbind(	\instrument, \glycine,
		\amp, Pseq(~amps, 4).collect { |amp| if(amp > 0) {amp} {Rest}},
		\dur, 0.02,
).play;
)



glycinerhythm.mp3

In other news, my collaborator Steve has been having Ideas. Watch this space.

Sonifying IR spectroscopy data – finding peaks

Emperor Joseph II: Well, I mean occasionally it seems to have, how shall one say? [he stops in difficulty; turning to Orsini-Rosenberg] How shall one say, Director?
Orsini-Rosenberg: Too many notes, Your Majesty?
Emperor Joseph II: [to Mozart] Exactly. Very well put. Too many notes.
From Amadeus (1984)

It occured to me after a while that my previous attempts at dealing with these sets of data were running into a ‘too many notes’ problem: 784 resonators at once is always likely to sound like noise! What one would like to be able to do would be to focus in on the visible ‘peaks’:

This is something a human can do quite intuitively: in fact, I seem to dimly remember that, many years ago, when I worked with HPLC (High Performance Liquid Chromatography) data at Schweppes, there was a pencil and paper method we used to estimate the height and width of a peak, and thus determine the concentration of a compound by calculating the area under the graph.

A little research into the problem of doing this algorithmically rapidly took me far out of my mathematical depth:

Chao Yang, Zengyou He, Weichuan Yu Comparison of public peak detection algorithms for MALDI mass spectrometry data analysis BMC Bioinformatics. 2009; 10: 4. Published online 2009 January 6. doi: 10.1186/1471-2105-10-4
http://www.ncbi.nlm.nih.gov/pmc/articles/PMC2631518/

Instead, I got some hints on a rather simpler approach from Daniel Mayer by asking a question on the SuperCollider mailing list.

Here’s the code I eventually came up with:

(
~name = "glycine";
~path = Document.current.dir.asString++"/"++ ~name ++".csv";
f = CSVFileReader.readInterpret(~path);

f = ((f.flop[1] * -1) + 1).normalize;

// these three lines remove plateaus in the data,
// otherwise we get missing 'peaks' in the analysis
// some int/float voodoo needed here!
f = (f*100).asInteger;
f = f.differentiate.removeEvery([0]).integrate;
f = f/100;

// the magic line which finds the peaks
~peaksIndices = f.differentiate.sign.findAll([1,-1]);

// putting the data back together again
g = Array.fill(f.size, 0);
~peaksIndices.do { |i| g[i] = f[i] };

~amps = g;
[f,~amps].plot(~name, Rect(840,0,600,450));

~freqs = (36..128).resamp1(f.size).midicps;

{ Splay.ar(Klank.ar(`[~freqs, ~amps, nil], PinkNoise.ar(0.01))) }.play;
)

At the very end of the plot you can see one of the problems: this method finds any and all local peaks, including ones which to the eye look unimportant:

I think what would be needed here would be some low-pass filtering to get rid of small glitches. However, the musical results so far are quite good: once again, here’s a short gesture made by crossfading from one compound to another:

Sonifying IR spectroscopy data – automating pitch

Going off in a bit of a different direction here, using the data as automation to drive the pitch of a synth:

(
f = CSVFileReader.readInterpret(Document.current.dir.asString++"/water.csv");

f = ((f.flop[1] * -1) + 1).normalize(48,84); //midinotes


Pmono( \default,
\midinote, Pseq(f, inf),
\dur, 0.005).play
)

In this recording, looping up the three chemicals one by one. Kind of cute – early days for this approach.

pmono01.mp3

Sonifying IR spectroscopy data – ‘chords’

Finding the .resamp1 method in SuperCollider gave me an idea for reducing this rather large set of data into something perhaps more musically useful. Could I make something more like a tonal chord, with pitches repeated in every octave?

I first drastically resampled my data into just twelve points:

f = ((f.flop[1] * -1) + 1).resamp1(12);

These would then be the probabilities of those twelve pitch classes appearing across a range of eight and a half octaves:

f = (f++f++f++f++f++f++f++f++f[..7]); // 104 notes

Then what I did was to multiply this chordal structure by the original data, so that my final sound is the ‘glycine chord’ amplitude modulated (sort of) by the absorbtion data.

Here’s the final code:

(
~name = "glycine";
~path = Document.current.dir.asString++"/"++ ~name ++".csv";
f = CSVFileReader.readInterpret(~path);
g = f;

f = ((f.flop[1] * -1) + 1).resamp1(12);
f = (f++f++f++f++f++f++f++f++f[..7]); // 104 notes

g = ((g.flop[1] * -1) + 1).resamp1(104); // 104 samples of orig graph

~amps = f.cubed * g; // combining two approaches
~amps = ~amps.normalize;
~amps.plot(~name, Rect(840,0,600,450));

~freqs = (25..128).midicps;

{ Splay.ar(Klank.ar(`[~freqs, ~amps, nil], PinkNoise.ar(0.01))) }.play;
)

I used this approach to make the sound below, which crossfades from glycine to tyrosine to water, then back to glycine again.