Tuesday, February 10, 2015

Episode 11: In the Mountains and in the Tombs

A further continuation of the rhythmic idea used in Episodes 7 and 8, this time implemented as a sctweet.

mp3 file: In the Mountains and in the Tombs (sctweet 20150210) (3.1 MB)
Full supercollider source: play{l=LFSaw;a=Decay.ar(Impulse.ar(1/8),0.2,l.ar(l.kr(2/25,0,88,176)));[16,10,4,3].do({|t|a=CombN.ar(a,6,t/8+[3,4],20,1,a)});a}//#sctweets (138 characters)

I managed to create an even shorter tweet, which differs only in the amplitude envelope of the notes. I didn't think it sounded quite as pretty, though:

play{l=LFSaw;a=HPF.ar(l.ar(1/8),8,l.ar(l.kr(2/25,0,88,176)));[16,10,4,3].do{|d|a=CombN.ar(a,6,d/8+[3,4],24,1,a)};a}// #sc140 #supercollider

The notes of this composition follow a cycle of 25 pitches, taking 3 minutes and 20 seconds to perform a single repeat. Each note is echoed in a complex rhythm, creating the arpeggios you hear. This recording follows one complete cycle of pitches.

Here's an expanded version of the tweet that explains what's going on:
(
{
 var pitch=LFSaw.kr(2/25,0,88,176);
 // the pitch rises from 88Hz to 264Hz (an octave and a fifth) in 12.5 seconds
 var tone=LFSaw.ar(pitch);
 // generate a sawtooth wave following the pitch
 var env=Decay.ar(Impulse.ar(1/8),0.2);
 // 0.2 second percussive envelope that repeats once every 8 seconds
 var note=env*tone;
 /* the original tweet performs the same multiplication in the
  * mul: parameter of the Decay ugen
  *
  * this combination produces the 25 note cycle. The notes
  * are harmonically related because the pitch rises in a linear
  * fashion. If the pitch doesn't wrap around before the next note,
  * it will be 32/25 * 88Hz higher. If it does wrap around, it
  * will be 18/25 * 88Hz lower. The total set of all notes played
  * consists of harmonic partials 13-37 of a fundamental frequency
  * of 7.04 Hz. (41 cents above A-6)
  */
 var delaytimes=[16,10,4,3];
 // delaytimes measured in 16th notes at 120bpm
 var out = note;
 // chain all the delays:
 delaytimes.do{|delay|
  var delayinseconds=delay/8;
  var stereodelay=[3,4];
  // left channel delays an additional 6 beats at 120bpm,
  // right channel delays an additional 8 beats
  out=CombN.ar(out,6,delayinseconds+stereodelay,24,1,out);
 };
 // uncomment this line to see what frequencies are being used:
 // Poll.ar(Impulse.ar(1/8),ZeroCrossing.ar(tone),"freq");
 out;
}.play
)

The multiple long delay times consume quite a bit of memory. To run these in supercollider, you may have to increase the server's memory capacity. This worked for me (run before booting the server):

s.options.memSize=(2**15)

As usual, the title of this track is chosen from a randomly selected Bible passage. By total coincidence, the song Legion by Severed Heads refers to the same passage.

No comments: