160 lines
4.6 KiB
Plaintext
160 lines
4.6 KiB
Plaintext
/*
|
|
|
|
written by Luka Prinčič for 'noether' release.
|
|
heavily inspired by chords written by Ichika Nito on a track 'Arpeggio'
|
|
|
|
*/
|
|
(
|
|
Server.default.waitForBoot { fork {
|
|
|
|
~revBus.free;
|
|
~revFx.free;
|
|
~revBus = Bus.audio(s, 2);
|
|
|
|
SynthDef(\bet, { |gate = 1, freq = 234, out = 0, pan = 0, amp = 0.1, cutoff = 4000 |
|
|
var snd, env, fenv;
|
|
freq = [freq, freq * 1.01] * Rand(0.995, 1.0);
|
|
freq = freq * SinOsc.kr(5).range(0.99, 1.01);
|
|
env = EnvGen.ar(Env.asr(0, 1, 3), gate, doneAction:2);
|
|
fenv = EnvGen.ar(Env.adsr(0.05, 0.5, 0.4, 2), gate);
|
|
snd = SinOsc.ar(freq);
|
|
snd = snd + Pulse.ar(freq * 0.5, mul:5);
|
|
snd = snd + LFTri.ar(freq * [1,2].choose * 1.01, mul:1);
|
|
snd = LPF.ar(snd, cutoff * fenv + 100);
|
|
snd = snd + Decimator.ar(snd, freq*30);
|
|
snd = snd * env * amp;
|
|
snd = Balance2.ar(snd[0], snd[1], pan, 0.7);
|
|
snd = snd * 0.4;
|
|
OffsetOut.ar(out, snd);
|
|
}).add;
|
|
|
|
SynthDef(\nhat, { |gate = 1, out = 0, amp = 0.1, rls = 0.2, pan = 0|
|
|
var snd, env;
|
|
env = EnvGen.ar(Env.asr(0, 1, rls, -10), gate:gate, doneAction: Done.freeSelf);
|
|
snd = WhiteNoise.ar;
|
|
snd = snd * env;
|
|
snd = BPF.ar(snd, 9000);
|
|
snd = snd * amp;
|
|
|
|
snd = Pan2.ar(snd, pan);
|
|
Out.ar(out, snd);
|
|
}).add;
|
|
|
|
SynthDef(\kick, { |gate = 1, out = 0, amp = 0.1, release = 0.9, freq=50, pan = 0, cutoff = 500, fxout=0, hpf=0 |
|
|
var snd, env, fenv;
|
|
fenv = EnvGen.ar(Env([freq*4,freq],0.08,'cub'));
|
|
snd = SinOsc.ar(freq: [fenv,fenv*2], mul:[1,0.4] ).sum;
|
|
snd = snd * LFPulse.ar(24).range(0.7,1).lag(0.02);
|
|
snd = snd + WhiteNoise.ar(0.3);
|
|
snd = snd + SinOsc.ar(freq: [freq*2,freq*4], mul:EnvGen.ar(Env.perc(0, 0.2)) * 0.5).sum;
|
|
snd = snd + LFTri.ar(freq: freq*4, mul:EnvGen.ar(Env.perc(0, 0.5)) * 0.3);
|
|
snd = RLPF.ar(snd, cutoff, 0.7);
|
|
snd = HPF.ar(snd, hpf);
|
|
snd = snd.softclip;
|
|
snd = snd * EnvGen.ar(Env.adsr(0, 0.05, 0.4, release, curve:'sqr'), gate: gate, doneAction:Done.freeSelf);
|
|
snd = snd * amp * 5;
|
|
snd = Pan2.ar(snd, pan);
|
|
//DetectSilence.ar(snd, doneAction:Done.freeSelf);
|
|
Out.ar(fxout, snd);
|
|
Out.ar(out, snd);
|
|
}).add;
|
|
|
|
// reverb synthdef
|
|
SynthDef(\revfx, { |inBus, outBus = 0, wet = 0.3, amp = 0.2|
|
|
var snd, rev;
|
|
|
|
snd = In.ar(inBus, 2);
|
|
snd = BHiShelf.ar(snd, 5000, db:-3);
|
|
rev = GVerb.ar(snd, 100, taillevel:wet);
|
|
rev = rev * amp;
|
|
|
|
OffsetOut.ar(outBus, rev);
|
|
}).add;
|
|
|
|
|
|
s.sync;
|
|
|
|
// reverb on a reverb bus
|
|
~revFx = Synth(\revfx, [\inBus, ~revBus, \amp, 0.4, \wet, 0.5], addAction:\addAfter);
|
|
|
|
s.sync;
|
|
|
|
|
|
// PATTERNS: ////////////////////////////////////////
|
|
|
|
t = TempoClock.default.tempo = 140/120;
|
|
|
|
Pbind(*[
|
|
instrument: \kick,
|
|
freq: Prand((1..9) * 0.1 + 1 + 50,inf),
|
|
dur: Pseq([2/3,2/3,1/3,2/3,1/6,1/6,1/3],inf) + Prand([0,0,1/3,1/6,2/3],inf),
|
|
sustain: 0.1,
|
|
hpf: Pseg([300,300,0,0,3000, 3000], [60, 60, 120, 30, 30]),
|
|
amp: Pseg([0, 0, 0.1, 0.1, 0.01, 0], [60, 60, 120, 20, 10], \sqr),
|
|
release: Prand((1..9) * 0.1, inf),
|
|
cutoff: Prand((1..9) * 500, inf),
|
|
]).play(quant:1);
|
|
|
|
Pbind(*[
|
|
instrument: \nhat,
|
|
dur: Pwrand([1/3, Pn(1/6,2)], [0.9,0.1], inf),
|
|
amp: Pseg([0, 0, 0.1, 0.1, 0], [60, 60, 120, 30]),
|
|
pan: Pwhite(-0.5,0.5),
|
|
sustain: Prand([0.002, 0.01, 0.02],inf)
|
|
]).play(quant:1);
|
|
|
|
Pbind(*[
|
|
instrument: \bet,
|
|
dur: Prand([
|
|
Pseq([1/3, 3/6, 1/3, 1/3, 1/6, 2/6],4),
|
|
Pseq([3/6, 1/3, 1/3, 1/6, 2/6, 1/3],4),
|
|
Pseq([1/3, 1/3, 1/6, 2/6, 1/3, 3/6],4),
|
|
Pseq([1/3, 1/6, 2/6, 1/3, 3/6, 1/3],4),
|
|
Pseq([1/6, 2/6, 1/3, 3/6, 1/3, 1/3],4),
|
|
Pseq([2/6, 1/3, 3/6, 1/3, 1/3, 1/6],4)
|
|
],inf),
|
|
|
|
// inspired by Ichika Nito - Arpeggio //
|
|
note: Pseq([
|
|
|
|
1, 13, 15, 20, 16, Rest(), // Dbm(add9)
|
|
-1, 11, 15, 20, 16, Rest(), // EM7/B
|
|
-3, 13, 15, 20, 16, Rest(), // Dbm(add9)/A
|
|
-3, 12, 18, 23, 25, Rest(), // Gbsus4(+11)/A
|
|
-6, 6, 9, 13, 20, Rest(), // Gbm(add9)
|
|
-4, 8, 12, 18, 16, 20, // Abaug7
|
|
|
|
1, 13, 15, 20, 16, Rest(), // Dbm(add9)
|
|
-1, 11, 15, 20, 16, Rest(), // EM7/B
|
|
-3, 13, 15, 20, 16, Rest(), // Dbm(add9)/A
|
|
-3, 12, 18, 23, 16, Rest(), //
|
|
-4, 6, 11, 15, 16, Rest(), // EM9/Ab
|
|
-4, 6, 13, 16, 25, 28, // Ab7sus4(-13(
|
|
|
|
-6, 6, 9, 13, 20, Rest(), // Gbm(add9)
|
|
-6, 8, 12, 18, 20, 16, // Abaug7
|
|
|
|
], inf),
|
|
|
|
octave:
|
|
Pseq([ Pn([4,5],14*6*2),Pn([4,5,6],14*6*2),
|
|
Pseq([
|
|
Prand([[5,4],[5,6],[4,5,6]]),
|
|
Pn(Pwrand([5,6],[0.9,0.1]), 5)
|
|
], 14*2),
|
|
Pseq([ Pn([4,5,6,7],14*6*4)])]),
|
|
|
|
detune: 3, // Hz added to final freq
|
|
legato: Pseq([4, Pn(Prand((2..5)*0.2),5)],inf) * 0.1,
|
|
cutoff: Prand((1..4),inf) *
|
|
Pseg([50, 500, 1000, 1000, 50, 10], [60, 60, 120, 30, 20], \cub),
|
|
amp: Pseg([0, 0.1, 0.1, 0.01, 0], [10, 120+180, 30, 10], \cub) * 0.6,
|
|
pan: Prand((0..10)-5*0.1, inf),
|
|
out: ~revBus,
|
|
]).play(quant:1)
|
|
|
|
}}
|
|
)
|
|
|
|
|