add beat generator and several beats song
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Tue, 21 Mar 2023 00:36:35 +0000 (01:36 +0100)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Tue, 21 Mar 2023 00:36:35 +0000 (01:36 +0100)
Зясах-Мыҏиӈё.scd

index 8a42c37..9eae77f 100644 (file)
@@ -30,7 +30,7 @@
         );
         sig = sig + partial;
       });
-      distort = 1 + (0.3 * ampEnv);
+      distort = 1 + (0.1 * ampEnv);
       sig = (sig * distort).clip(-1, 1);
       sig = Pan2.ar(sig, pan, amp);
       Out.ar(out, sig);
@@ -64,8 +64,8 @@
 )
 
 (
-~synthNames = ~synthGen.value;
-~reverbNames = ~reverbGen.value(prefix: \jumisevu);
+~synthNames = ~synthGen.value(130);
+~reverbNames = ~reverbGen.value(130, prefix: \jumisevu);
 )
 
 (
@@ -129,7 +129,7 @@ Pdef(\liwarypo, Pbind(*[
 
 (
 ~reverbSynths.do{|item|
-  item.set(\mix, 0.5.rand);
+  item.set(\mix, 0.2.rand);
 };
 )
 
@@ -234,6 +234,90 @@ Pdef(\rekyhabe, ~rekyhabe).quant_(1).stop;
 Pdef(\test, ~nyhoweni).quant_(1).play;
 )
 
+//// beats
+
+(
+TempoClock.tempo = 1/4;
+
+~beatGenerator = {|depth=1, attack=0.07, release=0.7,  chance=0.6|
+  var beat = [[1, 0, 0, attack, release]];
+  (depth-1).do{|i|
+    var newBeat = [];
+    beat.do{|hit, j|
+      chance.coin.if {
+        var newHit = [
+          hit[0] / 2,
+          hit[1] + 1,
+          -3 * i,
+          attack / (i+1),
+          release / (i+1),
+        ];
+        newBeat = newBeat.add(newHit).add(newHit);
+      } {newBeat = newBeat.add(hit)};
+    };
+    beat = newBeat;
+  };
+  beat;
+};
+
+~beatQogamocy = ~beatGenerator.(7);
+~qogamocy = Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(~beatQogamocy.size), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(~beatQogamocy.size), inf),
+  pan: [-1, 1],
+  scale: Pn(~scale),
+  octave: 2,
+  #[\dur, \degree, \db, \attack, \release]: Pseq(
+    ~beatQogamocy, inf,
+  ),
+  timingOffset: 0,
+]);
+Pdef(\qogamocy, ~qogamocy).quant_(1).stop;
+
+~beatJocenyne = ~beatGenerator.(7);
+~jocenyne = Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(~beatJocenyne.size), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(~beatJocenyne.size), inf),
+  pan: [-1, 1],
+  scale: Pn(~scale),
+  octave: 3,
+  #[\dur, \degree, \db, \attack, \release]: Pseq(
+    ~beatJocenyne, inf,
+  ),
+  timingOffset: 0,
+]);
+Pdef(\jocenyne, ~jocenyne).quant_(1).stop;
+
+~beatCocewary = ~beatGenerator.(7);
+~cocewary = Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(~beatCocewary.size), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(~beatCocewary.size), inf),
+  pan: [-1, 1],
+  scale: Pn(~scale),
+  octave: 4,
+  #[\dur, \degree, \db, \attack, \release]: Pseq(
+    ~beatCocewary, inf,
+  ),
+  timingOffset: 0,
+]);
+Pdef(\cocewary, ~cocewary).quant_(1).stop;
+
+~beatSicilaqe = ~beatGenerator.(7, chance: 0.5);
+~sicilaqe = Pbind(*[
+  out: Pshuf(~reverbBusses.wrapExtend(~beatSicilaqe.size), inf),
+  instrument: Pshuf(~synthNames.wrapExtend(~beatSicilaqe.size), inf),
+  pan: [-1, 1],
+  scale: Pn(~scale),
+  octave: 5,
+  #[\dur, \degree, \db, \attack, \release]: Pseq(
+    ~beatSicilaqe, inf,
+  ),
+  timingOffset: 0,
+]);
+Pdef(\sicilaqe, ~sicilaqe).quant_(1).stop;
+)
+
+Pdef.all.do{|i| i.stop};
 ////
 
 s.record(bus: a.h);