Ambient

Dinou – Algoambient

Aquesta és la versió estéreo i més breu de la peça per 8 canals que vaig tocar dissabte passat a l’Antic Forn de Vallcarca, amb visuals de Turbulente, en el context de l’Algobiente IV. Copio el codi en SuperCollider a continuació:

//sintes

(
SynthDef(\serra_multi, {
   arg freq=220, width=0.1, pan=0, atk=0.1, rel=0.4, vol=0.5;
   var env, sig;
   env = EnvGen.kr(Env([0.01, 1, 0.01], [atk, rel], \exp), doneAction: 2);
   sig =
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2) +
   VarSaw.ar(Rand(freq*0.95, freq*1.05), width: width, mul: 0.2);
   sig = sig * env;
   sig = Pan2.ar(sig, pan, vol);
   //sig = PanAz.ar(8, sig, pan, vol, 2, 0);
   Out.ar(0, sig);
}).add;
)

(
SynthDef(\sinus_perc_multi, {
   arg freq=100, pan=0, vol=0.2, atk=0.05, rel=0.2, curve= -8;
   var sig;
   sig =
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2) +
   SinOsc.ar(Rand(freq*0.99, freq*1.01), Rand(0, pi/2))*EnvGen.kr(Env.perc(atk, rel, curve: curve), doneAction: 2);
   sig = Pan2.ar(sig, pan, vol);
   //sig = PanAz.ar(8, sig, pan, vol, 2, 0);
   Out.ar(0, sig);
}).add;
)

(
SynthDef(\pulse_multi, {
   arg freq=100, atk=0.04, dur=5, rel=1, pan=0, vol=0.5;
   var sig, env;
   env = EnvGen.kr(Env([0.01, 0.5, 1, 0.01], [atk, dur, rel], \exp), doneAction: 2);
   sig =
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03) +
   Pulse.ar(freq*Rand(0.98, 1.02), SinOsc.kr(2).range(0.02, 0.98), 0.03);
   sig = sig * env;
   sig = Pan2.ar(sig, pan, vol);
   //sig = PanAz.ar(8, sig, pan, vol, 2, 0);
   Out.ar(0, sig);
}).add;
)


//patrons

(
Pdef(\agobiante,
   Pbind(
     \instrument, \serra_multi,
     \freq, Pexprand(40, 8000),
     \width, Pwhite(0.1, 0.9),
     \dur, Pwhite(0.5, 16),
     \atk, Pwhite(0.01, 16),
     \rel, Pwhite(0.01, 16),
     \vol, Pexprand(0.01, 1),
     //\pan, Pwhite(0, 2.5)
     \pan, Pwhite(-1, 1)
   )
).play;
)

(
Pdef(\ocells,
   Pbind(
     \instrument, \sinus_perc_multi,
     \freq, Pexprand(4000, 8000),
     \curve, Pwhite(-8, 0),
     \dur, Prand([0.125, 0.25, 8], inf),
     \rel, Pwhite(0.1, 0.4),
     \vol, Pexprand(0.01, 0.15),
     \pan, Pwhite(0, 2.5)
     //\pan, Pwhite(-1, 1)
   )
).play;
)

(
Pdef(\gotes,
   Pbind(
     \instrument, \sinus_perc_multi,
     \midinote,
     Pfsm([ //Gràcies RJdC ;-)
       #[0],
       70, #[1],
       69, #[2],
       67, #[0, 3],
       65, #[4],
       63, #[3, 5],
       62, #[6],
       60, #[7],
       58, #[0, 7, 8],
       57, #[9],
       55, #[10],
       53, #[9, 11],
       51, #[12],
       50, #[2, 7, 13],
       48, #[14],
       46, #[15],
       45, #[4, 0],
     ], inf),
     \curve, -8,
     \dur, Prand([0.125, 0.25, 8], inf),
     \vol, Pexprand(0.02, 0.05),
     //\pan, Pwhite(0, 2.5)
     \pan, Pwhite(-1, 1)
  )
).play(quant: 0.5);
)

(
Pdef(\drama,
   Pbind(
     \instrument, \pulse_multi,
     \midinote, Pseq([58, 60, 61, 60], inf),
     \dur, 2,
     \vol, 1,
     //\pan, Pwhite(0, 2.5)
     \pan, Pwhite(-1, 1)
  )
).play(quant: 8);
)

(
Pdef(\mes_drama,
   Pbind(
     \instrument, \pulse_multi,
     \midinote, Prand([64, 66, 67, 66], inf),
     \dur, 2,
     \vol, 1,
     //\pan, Pwhite(0, 2.5)
     \pan, Pwhite(-1, 1)
   )
).play(quant: 8);
)