Cubism (Variation 1) (2020)
for a SuperCollider program (2 SuperCollider Instruments)

A computer music piece inspired by the visual work of Erich Heckel, ‘The Glass Day’ (whose genre is marked as ‘German Expressionism’).
My title ‘Cubism’ stems from the observation of the cubic techniques presenting the ‘sky’ in the picture, and the composition techniques is Serialism. The piece is performed independently by the SuperCollider program. The pitch material is a set of development from an atonal Serial.
Code is divided into three part:
Part 1: 2 instruments, ‘R’ & ‘A’, are first defined using SynthDef, to create sonic landscape
that built the starry, light-sawtooth, slim-Sine flowing ambience in the background.
Part 2: Pitch material of the piece. First I define the time signature with TempoClock.new (170/60), then for each instuments, I use Pbind(…Pseq([Pn…]) for the development of sets of Serial (original Serial is (1,4), 4, 3, 4, 3, 6,5, 6,5). While all will be specified in the full code, the other serial development of scales and sequences are presented below:
Part 3: Structure of the piece, which is ordered in linear manner.
<!-- wp:code -->
<pre class="wp-block-code"><code>/Cubism (Variation 1)
//for a Supercollider Program (2 SuperCollider instruments)
//This is the first variation of an ambient composition. The composition is based on the development of a serial.
//The piece will be performed fully independently by the computer program.
//Run it with shift + return (Mac system) in SuperCollider.
//Composer: Yudan Zou
(
s.waitForBoot({
SynthDef("R", { arg freq=440, amp=0.2, att=0.03, dec=0.4, sus=0.32, rel=0.1, gate = 1, pan = 0, modFreqRatio = 1.8, modDepth = 1;
var carrier, modulator, snd, env;
env = Env.adsr(
attackTime: att,
decayTime: dec,
sustainLevel: sus,
releaseTime: rel,
peakLevel: amp
).kr(gate: gate);
carrier = Saw.ar(freq: freq);
modulator = Saw.ar(freq: freq * modFreqRatio).range(0, modDepth);
snd = carrier * modulator * 0.88;
snd = snd * env;
snd = Pan2.ar(in: snd, pos: pan);
Out.ar(0, snd);
DetectSilence.ar(snd, doneAction: 2);
}).add;
//Instruments 2
SynthDef(\A, { arg out=0, amp=1.0, gate=1, freq=320, bowOffset = 0.0, bowSlope = 0.8, bowPosition = 0.89, vibFreq=5.458, vibGain=0.08;
var betaRatio = 0.028136 + (0.2*bowPosition);
var baseDelay = freq.reciprocal;
var lastOut = LocalIn.ar(2);
var vibrato = SinOsc.ar(vibFreq, 0, vibGain);
var neckDelay = baseDelay*(1.0-betaRatio) + (baseDelay*vibrato);
var neck = DelayL.ar(lastOut[0], 0.08, neckDelay);
var bridge = DelayL.ar(lastOut[1], 0.045, baseDelay*betaRatio);
var stringFilter = OnePole.ar(bridge*0.95, 0.65);
var adsr = amp*EnvGen.ar(Env.adsr(0.03, 0.007, 1.0, 0.01), gate, doneAction: 2);
var bridgeRefl = stringFilter.neg;
var nutRefl = neck.neg;
var stringVel = bridgeRefl + nutRefl;
var velDiff = adsr - stringVel;
var slope = 5.0 - (4.0*bowSlope);
var bowtable = (( ((velDiff+bowOffset)*slope) + 0.59 ).abs ).pow(-4).clip(0, 1);
var newVel = velDiff*bowtable;
LocalOut.ar([bridgeRefl, nutRefl] + newVel);
Out.ar(out, Resonz.ar( bridge*0.6, 300, 0.78 ) );
}, [\ir, 0,0, 0, 0, 0, 0, 0, 0]).store;
//Composition Structure - Variation 1:
~timesignature = TempoClock.new(170/60).permanent_(true);
//for instrument "R"
~phraseRA = Pbind(
\instrument, "R",
\degree, Pseq([Pn(1, 4), 4, 3, 4, 3, 6, 5, 6, 5], inf),
\dur, 1/2,
\att, 0.02,
\rel, 2,
\amp, 0.2,
\ctranspose, 2
).play.stop;
~phraseRAa = Pbind(
\instrument, "R",
\degree, Pseq([Pn(1, 4), 6s, 7b, 8, 6b, 5b, 5, 7, 4b], inf),
\dur, 1/2,
\att, 0.02,
\rel, 2,
\amp, 0.2,
\ctranspose, 2
).play.stop;
~phraseRAb = Pbind(
\instrument, "R",
\degree, Pseq([Pn(1, 4), 11s, 12b, 13, 11b, 10b, 10, 12, 9b], inf),
\dur, 1/2,
\att, 0.02,
\rel, 2,
\amp, 0.2,
\ctranspose, 2
).play.stop;
~phraseR1a = Pbind(
\instrument, "R",
\degree, Pseq([9, 8, 3, 6, 9, 4, 5, 2], inf),
\dur, 1/6,
\att, 0.02,
\rel, 2,
\amp, 0.1,
\ctranspose, 2
).play.stop;
~phraseR1b = Pbind(
\instrument, "R",
\degree, Pseq([12, 11, 7, 10, 13, 8, 9, 8], inf),
\dur, 1/6,
\att, 0.02,
\rel, 2,
\amp, 0.1,
\ctranspose, 2
).play.stop;
~phraseR1c = Pbind(
\instrument, "R",
\degree, Pseq([15, 14, 9, 13, 16, 11, 12, 11], inf),
\dur, 1/6,
\att, 0.02,
\rel, 2,
\amp, 0.1,
\ctranspose, 2
).play.stop;
~phraseR1d = Pbind(
\instrument, "R",
\degree, Prand([18, 17, 12, 16, 19, 14, 15, 14], inf),
\dur, 1/6,
\att, 0.02,
\rel, 2,
\amp, 0.1,
\ctranspose, 2
).play.stop;
//chords: R
~chordR1 = Pbind(
\instrument, "R",
\dur, 1/2,
\degree, Pseq ([[6s, 7b, 8], [14, 9b, 13], [4, 5s, 2], [4b, 6b, 1b]],inf),
\ctranspose, 2,
\amp, 0.3,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.4,
\modDepth, 1
).play.stop;
~chordR2 = Pbind(
\instrument, "R",
\dur, 1/2,
\degree, Pseq ([[2s, 3b, 5], [10, 5b, 9], [1, 2s, 3s], [5b, 6s, 3s]],inf),
\ctranspose, 2,
\amp, 0.3,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.4,
\modDepth, 1
).play.stop;
~chordR3 = Pbind(
\instrument, "R",
\dur, 1/2,
\degree, Prand ([[2s, 3b, 5], [10, 5b, 9], [1, 2s, 3s], [5b, 6s, 3s]],inf),
\ctranspose, 2,
\amp, 0.3,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.2,
\modDepth, 1,
\strum, 0.1
).play.stop;
~chordR3a = Pbind(
\instrument, "R",
\dur, 1/2,
\degree, Pseq ([[2s, 3b, 5], [10, 5b, 9], [1, 2s, 3s], [5b, 6s, 3s]],inf),
\ctranspose, 2,
\amp, 0.1,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.2,
\modDepth, 1,
\strum, 0.1
).play.stop;
///Serial Development: scales and sequences
//the Base
~scale1 = [15, 14, 9, 13, 16, 11, 12, 11];
~scale2 = [4, 3, 4, 3, 6, 5, 6, 5];
~scale3 = [6s, 7b, 8, 6b, 5b, 5, 7, 4b];
~scale4 = [9, 8, 3, 6, 9, 4, 5, 2];
s.boot;
//scale 4 based
~phraseA1 = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Pseq(~scale4.reverse-12s, inf),
\amp, 0.3,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
~phraseA1a = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Pseq(~scale4.reverse-6s, inf),
\amp, 0.3,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
//scale2 based
~phraseA2 = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Pseq(~scale2+9b, inf),
\amp, 0.1,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
~phraseA2a = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Pseq(~scale2+15b, inf),
\amp, 0.1,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
//scale1 based
~phraseA2b = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Prand(~scale1+9b, inf),
\amp, 0.05,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
~phraseA1b = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Prand(~scale1-25b, inf),
\amp, 0.4,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
//scale3 based
~phraseA2c = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Prand(~scale3+20s, inf),
\amp, 0.05,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
~phraseA1c = Pbind(
\instrument, "A",
\dur, 1/6,
\degree, Prand(~scale3-18s, inf),
\amp, 0.8,
\sus, 0.5,
\rel, 1.3,
\strum, 0.2
).play.stop;
//chord
~chordA1 = Pbind(
\instrument, "A",
\dur, 1/2,
\degree, Pseq ([[6s, 7b, 8], [14, 9b, 13], [4, 5s, 2], [4b, 6b, 1b]].reverse+8,inf),
\ctranspose, 2,
\amp, 0.1,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.8,
\modDepth, 1,
\strum, 0.2,
\ctranspose, 3
).play.stop;
~chordA2 = Pbind(
\instrument, "A",
\dur, 1/2,
\degree, Pseq ([[2s, 3b, 5], [10, 5b, 9], [1, 2s, 3s], [5b, 6s, 3s].reverse-7b],inf),
\ctranspose, 2,
\amp, 0.1,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.9,
\modDepth, 1,
\ctranspose, 3
).play.stop;
~chordA3 = Pbind(
\instrument, "A",
\dur, 1/2,
\degree, Prand ([[2s, 3b, 5], [10, 5b, 9], [1, 2s, 3s], [5b, 6s, 3s]].reverse+6s,inf),
\ctranspose, 2,
\amp, 0.1,
\sus, 0.3,
\rel, 1.4,
\modFreqRatio, 0.2,
\modDepth, 1,
\strum, 0.1,
\ctranspose, 3
).play.stop;
//groups
// ~group1 =
(
~phraseA2.reset.play(~timesignature);
~phraseA1.reset.play(~timesignature);
).play;
// ~group2 =
(
~phraseA2a.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
).play;
// ~group3 =
(
~phraseA1b.reset.play(~timesignature);
~phraseA2b.reset.play(~timesignature);
).play;
// ~group4 =
(
~phraseA1c.reset.play(~timesignature);
~phraseA2c.reset.play(~timesignature);
).play;
//all the phrases
// ~phraseRA.reset.play(~timesignature);
// ~phraseRAa.reset.play(~timesignature);
// ~phraseRAb.reset.play(~timesignature);
// ~phraseR1a.reset.play(~timesignature);
// ~phraseR1b.reset.play(~timesignature);
// ~phraseR1c.reset.play(~timesignature);
// ~phraseR1d.reset.play(~timesignature);
// ~chordR1.reset.play(~timesignature);
// ~chordR2.reset.play(~timesignature);
// ~chordR3.reset.play(~timesignature);
// ~chordR3a.reset.play(~timesignature);
// ~phraseA1.reset.play(~timesignature);
// ~phraseA2.reset.play(~timesignature);
// ~phraseA1a.reset.play(~timesignature);
// ~phraseA2a.reset.play(~timesignature);
// ~phraseA2b.reset.play(~timesignature);
// ~phraseA1b.reset.play(~timesignature);
// ~phraseA2c.reset.play(~timesignature);
// ~phraseA1c.reset.play(~timesignature);
// ~chordA1.reset.play(~timesignature);
// ~chordA2.reset.play(~timesignature);
// ~chordA3.reset.play(~timesignature);
//Structure
//Score: a Routine
{
~phraseA2.stop;
~phraseR1a.reset.play(~timesignature);
16.wait;
~phraseR1a.stop;
~phraseR1b.reset.play(~timesignature);
16.wait;
~phraseR1b.stop;
~phraseR1c.reset.play(~timesignature);
16.wait;
~phraseR1c.stop;
~phraseR1d.reset.play(~timesignature);
16.wait;
~phraseR1d.stop;
~phraseR1c.reset.play(~timesignature);
8.wait;
~phraseA2.reset.play(~timesignature);
2.wait;
~phraseA2.stop;
~phraseR1c.stop;
~chordR3.reset.play(~timesignature);
~phraseA2.reset.play(~timesignature);
16.wait;
~chordR3.stop;
~phraseA2.stop;
~chordR3a.reset.play(~timesignature);
~phraseA2.reset.play(~timesignature);
16.wait;
~chordR3a.stop;
~phraseA2.stop;
~phraseR1c.reset.play(~timesignature);
8.wait;
~phraseR1c.stop;
~phraseR1b.reset.play(~timesignature);
8.wait;
~phraseR1b.stop;
~phraseR1a.reset.play(~timesignature);
8.wait;
~phraseR1a.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
~phraseA1.reset.play(~timesignature);
16.wait;
~phraseR1a.stop;
~chordR1.stop;
~phraseA1.stop;
~phraseR1a.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
16.wait;
~chordR2.stop;
~phraseA1.stop;
~phraseA1a.reset.play(~timesignature);
~phraseA2a.reset.play(~timesignature);
16.wait;
~phraseA1a.stop;
~phraseA2a.stop;
~phraseA2b.reset.play(~timesignature);
~phraseA1b.reset.play(~timesignature);
16.wait;
~phraseA2b.stop;
~phraseA1b.stop;
~phraseA2c.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
16.wait;
~chordA1.reset.play(~timesignature);
~chordA2.reset.play(~timesignature);
~chordA3.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~chordR1.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
~chordA1.reset.play(~timesignature);
~chordA2.reset.play(~timesignature);
~chordA3.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~chordA1.stop;
~chordA2.stop;
~chordA3.stop;
~phraseR1a.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~phraseR1a.stop;
~phraseR1b.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~phraseR1b.stop;
~phraseR1c.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~phraseR1c.stop;
~chordR2.stop;
~phraseR1d.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
16.wait;
~chordR1.reset.play(~timesignature);
~phraseR1d.reset.play(~timesignature);
~phraseRA.reset.play(~timesignature);
16.wait;
~chordR1.stop;
~phraseR1d.reset.play(~timesignature);
~phraseRA.reset.play(~timesignature);
16.wait;
~phraseRA.stop;
~phraseR1d.reset.play(~timesignature);
~phraseRAa.reset.play(~timesignature);
16.wait;
~phraseRAa.stop;
~phraseR1d.stop;
~phraseR1a.reset.play(~timesignature);
~phraseRAb.reset.play(~timesignature);
16.wait;
~phraseR1a.reset.play(~timesignature);
~phraseRAb.reset.play(~timesignature);
~chordR1.reset.play(~timesignature);
~chordR2.reset.play(~timesignature);
~phraseA1c.reset.play(~timesignature);
~phraseA1a.reset.play(~timesignature);
8.wait;
~phraseR1a.stop;
~phraseRAb.stop;
~chordR1.stop;
~chordR2.stop;
~phraseA1a.reset.play(~timesignature);
2.wait;
}.fork(~timesignature);
});
);
s.record;
s.stopRecording;
</code></pre>
<!-- /wp:code -->