Add improvisations
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 23 May 2022 15:46:22 +0000 (18:46 +0300)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 23 May 2022 15:46:22 +0000 (18:46 +0300)
Хэзифу/33.7.4.7-Фёбёґе.scd [new file with mode: 0644]
Хэзифу/33.7.5.1-morning.scd [new file with mode: 0644]

diff --git a/Хэзифу/33.7.4.7-Фёбёґе.scd b/Хэзифу/33.7.4.7-Фёбёґе.scd
new file mode 100644 (file)
index 0000000..c5fd626
--- /dev/null
@@ -0,0 +1,157 @@
+// Init
+// TODO: move into classes or startup
+
+(
+~co = Environment[
+  // drumkit midi mappings
+  \bass -> 36,
+  \side -> 37,
+  \snare -> 38,
+  \clap -> 39,
+  \rim -> 40,
+  \tomfloor -> 41,
+  \hatclosed -> 42,
+  \tomlow -> 43,
+  \hatpedal -> 44,
+  \tomhigh -> 45,
+  \hatopen -> 46,
+  \cowbell -> 47,
+  \ride -> 48,
+  \ccrash -> 49,
+  \ride2 -> 50,
+  \splash -> 51,
+  \hatsemiopen -> 52,
+  \bell -> 53,
+];
+~co.know = true;
+
+//=== MIDI setup
+MIDIClient.init;
+MIDIIn.connectAll;
+MIDIClient.destinations.do({ arg item;
+  switch (item.device,
+    "amsynth",
+    { ~co.outAmsynth = MIDIOut(0, item.uid); },
+    "Hydrogen",
+    { ~co.outHydrogen = MIDIOut(0, item.uid); },
+    "LinuxSampler",
+    { ~co.outLinuxSampler = MIDIOut(0, item.uid); }
+  );
+});
+
+//=== Beat patterns
+~bi = Environment[
+  // plain dnb
+  \koxa -> Pbind(
+    \midinote,
+    Pseq([~co.bass, ~co.snare], 2),
+    \dur,
+    Pseq([1, 1.5 , 0.5, 1]),
+  ),
+];
+~bi.know = true;
+
+//=== Device patterns
+~de = Environment[
+  // amsynth
+  \sowu -> Pbind(
+    \type, \midi,
+    \midiout, ~co.outAmsynth,
+    \midicmd, \noteOn,
+    \chan, 1,
+  ),
+
+  // Hydrogen
+  \feja -> Pbind(
+    \type, \midi,
+    \midiout, ~co.outHydrogen,
+    \midicmd, \noteOn,
+    \chan, 1,
+  ),
+
+  // linuxsampler
+  \dufe -> Pbind(
+    \type, \midi,
+    \midiout, ~co.outLinuxSampler,
+    \midicmd, \noteOn,
+    \chan, 1,
+  ),
+];
+~de.know = true;
+
+"Ҙыԃегы кёԋю жуҫище дёҏеке".postln;
+)
+
+// input
+
+(
+SynthDef(\mixer, {|in=0, out=0, amp=1|
+  var sig = SoundIn.ar([in, in+1], amp);
+  Out.ar(out, sig)
+}).add;
+
+SynthDef(\echo, {|in=0, out=0|
+  var sig, rev;
+  sig = In.ar(in, 2);
+  rev = JPverb.ar(sig, t60: 1.0, damp: 0.0, size: 1.0, earlyDiff: 0.707, modDepth: 0.1, modFreq: 2.0, low: 1.0, mid: 1.0, high: 1.0, lowcut: 500.0, highcut: 2000.0);
+  Out.ar(out, sig+rev);
+}).add;
+)
+
+~sources = Group.new;
+~effects = Group.new(addAction: \addToTail);
+
+~sourceBus = Bus.audio(s, 2);
+
+//~micInput = Synth(\mixer, [in: 0,
+~drumInput = Synth(\mixer, [in: 2], ~sources);
+~pianoInput = Synth(\mixer, [in: 4], ~sources);
+~amsynthinput = Synth(\mixer, [in: 6], ~sources);
+~sources.set(\out, ~sourceBus);
+
+~echo = Synth.new(\echo, [in: ~sourceBus], ~effects);
+
+// beats
+
+TempoClock.tempo = 2;
+
+(
+Pdef(\qixu, Pbind(*[
+  midinote: ~co.bass,
+  dur: Pseq([4, 4, 4, 2, 1, 1].normalizeSum*4, inf),
+  db: -7,
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\rodi, Pbind(*[
+  midinote: Prand([~co.snare, ~co.rim], inf),
+  dur: Pseq([Rest(0.2), 4, 4, 4, 2, 1, 0.8]/4, inf),
+  db: Pwhite(-20, -15, inf),
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\cubu, Pbind(*[
+  midinote: Prand([~co.hatclosed, ~co.hatpedal], inf),
+  dur: Prewrite(1, [
+    1: [1, 2, 3],
+    2: [3, 2, 1],
+    3: [1, 2, 1],
+  ], 6)*3/16,
+  db: Pwhite(-20, -17, inf),
+]) <> ~de.feja).quant_(4).stop;
+)
+
+(
+Pdef(\gofu, Pbind(*[
+  midinote: Prand([53, 60, 67, 74], inf)+Prand([12], inf),
+  dur: Prewrite(2, [
+    1: [1, 2, 3],
+    2: [3, 2, 1],
+    3: [1, 2, 1],
+  ], 7)*3/16,
+  db: Pwhite(-7, -10, inf),
+  legato: Phprand(0.5, 0.9, inf),
+]) <> ~de.dufe).quant_(4).stop;
+)
\ No newline at end of file
diff --git a/Хэзифу/33.7.5.1-morning.scd b/Хэзифу/33.7.5.1-morning.scd
new file mode 100644 (file)
index 0000000..78e1a0a
--- /dev/null
@@ -0,0 +1,37 @@
+(
+SynthDef(\drum, {|out=0, amp=1, freq=110,
+  sustain=1.0, attack=0.01, tension=0.01, loss=0.999999|
+  var sig, env;
+  sig = SinOsc.ar(freq, mul: 0.5) + BrownNoise.ar(mul: 0.5);
+  env = Env.perc(attack, sustain-attack);
+  sig = sig * EnvGen.ar(env, doneAction: 2);
+  sig = MembraneCircle.ar(sig, tension, loss, mul: amp);
+  sig = Pan2.ar(sig, Rand(-0.3, 0.3));
+  Out.ar(out, sig);
+}).add;
+)
+
+(
+Pdef(\ritm, Pbind(*[
+  instrument: \drum,
+  dur: 1,
+  db: -30,
+  //octave: 3,
+  //note: 0,
+  freq: 50,
+  legato: 2,
+  tension: 0.03,
+  loss: 0.9999,
+])).quant_(1).stop;
+)
+
+(
+{ var excitation = EnvGen.kr(Env.perc,
+                            MouseButton.kr(0, 1, 0),
+                             timeScale: 0.1, doneAction: 0
+                            ) * PinkNoise.ar(0.4);
+  var tension = MouseX.kr(0.01, 0.1);
+  var loss = MouseY.kr(0.999999, 0.999, 1);
+  MembraneCircle.ar(excitation, tension, loss);
+}.play;
+)
\ No newline at end of file