3. Two Metronomes
Materials Used: Metronomes, Audix f9, Macbook Pro, MOTU 4Pre, SuperCollider
How it was made:
Sound of two metronomes clicking in different BPM is fed to the computer. It acts an amplitude envelope (think of a gate plug-in) for an algorithmically generated harmonic progression in e minor.
Inspiration: Ligeti Symphonic Poem for 100 Metronomes
This comment has been removed by the author.
ReplyDelete//Sure!
DeleteSynthDef("Instr1",{
arg amp,dur,pitch,output=101,atk,rel,pan;
var env,envgen,sound,soun1,sound2;
env = Env.new([0.00001,amp,amp*0.8,0.00001],[dur*4*atk,dur,dur*5*rel],'exponential');
envgen = EnvGen.kr(env,doneAction:2);
sound = SinOsc.ar([pitch,pitch*1.012,pitch*0.993],mul:envgen);
sound = Pan2.ar(sound.sum,pan);
Out.ar(output,sound*0.3);
}
).load(s);
SynthDef("Instr2",{
arg amp,dur,pitch,output=101,atk,rel,pan;
var env,envgen,sound,soun1,sound2,sound3;
env = Env.new([0.00001,amp,amp*0.8,0.00001],[dur*4*atk,dur,dur*5*rel],'exponential');
envgen = EnvGen.kr(env,doneAction:2);
sound = Saw.ar([pitch,pitch*2.02,pitch*3.03],mul:[0.3,0.2,0.1]*envgen);
sound2 = LFTri.ar(pitch,mul:0.25*envgen);
sound3 = Pan2.ar((sound.sum)+sound2,pan);
Out.ar(output,sound3*0.3*0.6);
}
).load(s);
~fourpre=[3,4];
~bpm = 120 ; //bpm of the slower metronome;
~metrodelay= 60/~bpm;
~delaydur = 60*4;
SynthDef("Metronome",{
arg output=0;
var mix,metroin,synthin,ampcontrol,source,delay,delayamp;
synthin = In.ar(101,2);
metroin = HPF.ar(AudioIn.ar(3),50);
delayamp = XLine.kr(0.0001,0.9,~delaydur);
delay = CombC.ar(metroin,~metrodelay,~metrodelay*0.25,1.6*delayamp,delayamp,metroin);
//ampcontrol = Amplitude.ar(metroin*(16.dbamp),0.01,0.1);
ampcontrol = Amplitude.ar(delay*(16.dbamp),0.01,0.1);
source = ampcontrol*synthin;
4.do({ source = AllpassN.ar(source, 0.023, [0.010.rand,0.011.rand],2.2) });
source=LPF.ar(source,10000);
mix = source+ (delay*0.7);
Out.ar(output,mix);
}).load(s);
//pitch section
~octave=12*[4,5,6]; //octave transposition
~bass=12*[4,4,3]; //bass note
//chords
~am7=[9,0,4,7];
~d7=[2,6,9,0];
~dm7=[2,5,9,0];
~gmaj7=[7,11,2,6];
~cmaj7=[0,4,7,11];
~fsm7b5=[6,9,0,4];
~b7=[11,3,6,9];
~b7b9=[11,3,6,9,0];
~em=[4,4,7,7,11];
~em7=[4,7,11,2];
//transposition and chord progression
~transpose = 0.18;
~chord=[~am7,~d7,~gmaj7,~cmaj7,~fsm7b5,~b7,~em,~em,
~fsm7b5,~b7b9,~em,~em,~am7,~d7,~gmaj7,
~fsm7b5,~b7b9,~em7,~dm7,~cmaj7,~b7,~em,~em]+~transpose;
/*~chord=[~am7,~d7,~gmaj7,~cmaj7,~fsm7b5,~b7,~em,~em,
~am7,~d7,~gmaj7,~cmaj7,~fsm7b5,~b7,~em,~em,
~fsm7b5,~b7b9,~em,~em,~am7,~d7,~gmaj7,
~fsm7b5,~b7b9,~em7,~dm7,~cmaj7,~b7,~em,~em]+~transpose;*/
//tempo & beat duration
~beatdur = 1.5; //BPM = 60/~beatdur
~subdivision = ~beatdur*[0,1,2,4];
//volume
~vol = Array.interpolation(9,0.5,0.6);
//note duration
~notedur=~beatdur*[1,2,4];
~bnotedur=~beatdur*[1,2,4]*2;
~atktime=[1,1.05,1.1]*0.3;
~reltime=~atktime*5.2;
~sound=Synth.new("Metronome");
//form
~repeat=1; //how many times
~r1=Routine({~repeat.do({
~chord.size.do({
arg chordnow;
/*~chord.at(chordnow).postln;*/
Synth.before(~sound,"Instr1",[\output,0,\amp,~vol.choose,
\dur,~bnotedur.choose,\pan,1.0.rand2,
\atk,0.4, \rel,~reltime.choose,
\pitch,(~chord.at(chordnow).at(0)+(~bass.choose)).midicps]);
~chord.at(chordnow).asList.do({
arg note;
//note.postln;
~chord.at(chordnow).postln;
~chooseinst=[0,0].choose;
if(~chooseinst==1){
Synth.before(~sound,"Instr1",[\output,101,\amp,1.5*~vol.choose,\dur,~notedur.choose,
\pan,1.0.rand2,\atk,~atktime.choose, \rel,~reltime.choose,
\pitch,(note+(~octave.choose)).midicps]);}
{Synth.before(~sound,"Instr2",[\output,101,\amp,1.5*~vol.choose,\dur,~notedur.choose,
\pan,1.0.rand2,\atk,~atktime.choose, \rel,~reltime.choose,
\pitch,(note+(~octave.choose)).midicps]);
};
~subdivision.choose.wait;
});
})
})}); //end of routine and ~repeat.do
///////
~start =10;
SystemClock.sched(~start,{~r1.reset;~r1.play});
s.record
//s.stopRecording