сделать генератор синтов и ревербов и поэкспериментировать с параметрами
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Sun, 12 Mar 2023 20:09:50 +0000 (21:09 +0100)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Sun, 12 Mar 2023 20:09:50 +0000 (21:09 +0100)
Зясах-Мыҏиӈё.scd [new file with mode: 0644]

diff --git a/Зясах-Мыҏиӈё.scd b/Зясах-Мыҏиӈё.scd
new file mode 100644 (file)
index 0000000..9947d08
--- /dev/null
@@ -0,0 +1,126 @@
+(
+~synthGen = {|n=15, prefix=\fokyxiqa|
+  var synthNames = Array(n);
+  n.do{|i|
+    var synthName = (prefix ++ i.asString).asSymbol;
+    synthNames = synthNames.add(synthName);
+    SynthDef(synthName, {|
+      freq = 440,
+      attack = 0.01,
+      release = 1.0,
+      amp = 1,
+      pan = 0,
+      out = 0
+      |
+      var sig = SinOsc.ar(freq, 2pi.rand);
+      var num = 11;
+      var partial;
+      sig = sig * EnvGen.kr(Env.perc(attack, release), doneAction: 2);
+      num.do({
+        var pfact = rrand(2, 41);
+        partial = SinOsc.ar(freq * pfact, 2pi.rand);
+        partial = partial * EnvGen.kr(
+          Env.perc(attack, release),
+          levelScale: pfact.reciprocal * 1.3.rand,
+          timeScale: 1.0.rand * pfact.reciprocal,
+        );
+        sig = sig + partial;
+      });
+      sig = Pan2.ar(sig, pan, amp);
+      Out.ar(out, sig);
+    }).add;
+  };
+  synthNames;
+};
+
+~reverbGen = {|n=15, prefix=\fokyxiqa|
+  var synthNames = Array(n);
+  n.do{|i|
+    var synthName = (prefix ++ i.asString).asSymbol;
+    synthNames = synthNames.add(synthName);
+    SynthDef(synthName, {|
+      in,
+      mix = 1,
+      out = 0
+      |
+      var sig = In.ar(in, 2);
+      sig = FreeVerb2.ar(
+        sig[0], sig[1],
+        mix: mix,
+        room: 1.0.rand,
+        damp: 1.0.rand,
+      );
+      Out.ar(out, sig);
+    }).add;
+  };
+  synthNames;
+}
+)
+
+~synthNames = ~synthGen.value;
+~reverbNames = ~reverbGen.value(prefix: \jumisevu);
+
+(
+~reverbSynths = Array(~reverbNames.size);
+~reverbBusses = Array(~reverbNames.size);
+~reverbNames.do{|item|
+  ~reverbBusses = ~reverbBusses.add(Bus.audio(s, 2));
+  ~reverbSynths = ~reverbSynths.add(Synth(item, [
+    in: ~reverbBusses.last,
+    out: a.h,
+  ], s, \addToTail));
+};
+)
+
+~tuning = Tuning.et(13);
+~scale = Scale.new(#[0, 3, 5, 8, 10], 13, ~tuning);
+
+(
+Pdef(\hihymive, Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(9), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(9), inf),
+  db: -12,
+  pan: Pwhite(-0.5, 0.5),
+  dur: 1/3,
+  attack: Pwhite(0.01, 0.02),
+  release: Pwhite(0.8, 1.0),
+  scale: Pn(~scale),
+  octave: 2,
+  degree: Pn(Pshuf((0..8), 3), inf),
+])).quant_(3).play;
+
+Pdef(\pafajyry, Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(15), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(15), inf),
+  db: -19,
+  pan: Pwhite(-0.3, 0.3),
+  dur: 1/5,
+  attack: Pwhite(0.01, 0.02),
+  release: Pwhite(0.3, 0.5),
+  scale: Pn(~scale),
+  octave: 4,
+  degree: Pn(Pshuf((0..14), 2), inf),
+])).quant_(3).play;
+
+Pdef(\liwarypo, Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(5), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(5), inf),
+  db: -28,
+  pan: Pwhite(-0.2, 0.2),
+  dur: 3/5,
+  offset: 1/10,
+  attack: Pwhite(0.005, 0.01),
+  release: Pwhite(0.1, 0.2),
+  scale: Pn(~scale),
+  octave: 8,
+  degree: Pn(Pshuf((0..4), 4), inf),
+])).quant_(3).play;
+)
+
+(
+~reverbSynths.do{|item|
+  item.set(\mix, 0.1);
+};
+)
+
+s.record(bus: a.h);
\ No newline at end of file