play on midi-keyboard; params depend on note
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 27 Mar 2023 00:28:51 +0000 (02:28 +0200)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 27 Mar 2023 00:28:51 +0000 (02:28 +0200)
Зясах-Мыҏиӈё.scd

index 1ad4d43..326138b 100644 (file)
@@ -464,8 +464,8 @@ Pdef.all.do{|i| i.stop};
 )
 
 (
-TempoClock.tempo = 1/4;
-thisThread.randSeed = 1011;
+TempoClock.tempo = 1/8;
+thisThread.randSeed = 2001;
 Pdef(2, ~makeBeatPat.(0.1, 2, -3-100)).quant_(4).play;
 Pdef(3, ~makeBeatPat.(0.2, 3, -5-100)).quant_(4).play;
 Pdef(4, ~makeBeatPat.(0.35, 4, -12-100)).quant_(4).play;
@@ -474,6 +474,39 @@ Pdef(6, ~makeBeatPat.(0.75, 6, -30-100)).quant_(4).play;
 Pdef(7, ~makeBeatPat.(0.9, 7, -39-100)).quant_(4).play;
 )
 
+//// testing synth and scale on keyboard
+
+~kedifu = MidiRemote25SL();
+
+(
+~synthChooser = {
+  ~synthNames.choose
+};
+
+~kedifu.mod_{|v|
+  ~distort = v*10;
+};
+
+~keyParams = {|freq, v|
+  [
+    attack: 0.05 * (freq.cpsoct**(-0.5)),
+    release: 1.0 * (freq.cpsoct**(-0.9)),
+    distort: ~distort,
+    detuneMax: 0.05,
+    lowHarm: 2,
+    highHarm: (91 * (freq.cpsoct**(-0.6))).round,
+    harmMul: 1.3,
+    harmLen: 1.0,
+    out: ~reverbBusses.choose,
+  ];
+};
+)
+
+(
+~keys = KeySynth(~kedifu, ~synthChooser, 12/13, true, {|f,v|~keyParams.(f,v)}, 0.3,
+  onlyWhite: true, scale: ~scale);
+)
+~keys.synthName = \dyti;
 ////
 
 s.record(bus: a.h);
\ No newline at end of file