Make bind instead of event / explore scales and tunings
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 9 May 2022 13:17:28 +0000 (16:17 +0300)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 9 May 2022 13:17:28 +0000 (16:17 +0300)
sampler.scd
test.scd

index e8e7ea5..ae5b7d2 100644 (file)
         [\out, 0, \buf, zi.buf, \startPos, zi.startPos, \duration, zi.duration],
         addAction: \addToHead);
     },
-    \makeSynthEvent -> { |zi|
-      "makeSynthEvent called".postln;
-      (
-        instrument: \samplerPlay,
-        buf: zi.buf,
-        startPos: zi.startPos,
-        duration: zi.duration,
+    \makeSynthBind -> { |zi|
+      "makeSynthBind called".postln;
+      Pbind(
+        \instrument, \samplerPlay,
+        \buf, zi.buf,
+        \startPos, zi.startPos,
+        \duration, zi.duration,
       );
     },
     \makeSynthArgs -> { |zi|
index 322efd9..4e2a277 100644 (file)
--- a/test.scd
+++ b/test.scd
@@ -215,4 +215,80 @@ try { Exception.new().throw; ret = 1; } { ret = 2 };
 
 ~caller.func
 
-~se.maxDur
\ No newline at end of file
+~se.maxDur
+
+//=========================== scale experiments
+
+(
+//(note: 9, octave: 5).play;
+~se2.startRec;
+)
+~se2.stopRec;
+
+~se2.shiftPos(0.05);
+~se2.duration = ~se.duration - 0.05;
+~se2.playSample;
+Scale
+Tuning.directory
+(0..12).collect(_ * (3 ** (1/13)))
+~tun = Tuning.new((0..12).collect(_ * (12*(3 ** (1/13)).log2)), 3, "tritave");
+~scale = Scale.chromatic(~tun);
+
+(
+Pdef(\sampe, ~se.makeSynthBind <> Pbind(
+  \scale, ~scale,
+  \octave, 5,
+  \note, Pseq([[0, -7]]++(9!8), inf),
+  \dur, 3,
+  \db, -10,
+)).quant_(9).stop;
+)
+(
+Pdef(\sampo, ~se.makeSynthBind <> Pbind(
+  \scale, ~scale,
+  \octave, 5,
+  \note, Pxrand([2, 5, 8, 11], inf),
+  \dur, 1,
+  \db, -20,
+  \timingOffset, 1/3,
+)).quant_(9).stop;
+)
+(
+Pdef(\sampi, ~se.makeSynthBind <> Pbind(
+  \scale, ~scale,
+  \octave, 7,
+  \note, Pxrand((1,3..12), inf),
+  \dur, 1,
+  \db, -30,
+  \timingOffset, 1/6,
+)).quant_(9).stop;
+)
+
+TempoClock.tempo = 2;
+(
+Pdef(\teste, Pbind(
+  \dur, 1
+)).stop;
+)
+~se2 = ~samplerFactory.value;
+(
+Pdef(\samia, ~se.makeSynthBind <> Pbind(
+  \scale, ~scale,
+  \octave, 5,
+  \note, Pseq((0..12)++(11..1) +.t [0, 7], inf),
+  \dur, 4,
+  \db, -1,
+  \timingOffset, 0,
+)).quant_(4).stop;
+)
+[1, 2] +.t [0, 3]
+(
+Pdef(\samei, ~se2.makeSynthBind <> Pbind(
+  \scale, ~scale,
+  \octave, 5,
+  \note, Pseq((0..12)++(11..1) +.t [0, 3], inf),
+  \dur, 3,
+  \db, -15,
+  \timingOffset, 0,
+)).quant_(4).stop;
+)
\ No newline at end of file