Cleanup sampler from debug messages
authorEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 16 May 2022 17:56:36 +0000 (20:56 +0300)
committerEugene Petkevich <nasedil.genio.code@gmail.com>
Mon, 16 May 2022 17:56:36 +0000 (20:56 +0300)
Хэзифу/sampler.scd

index ccd5c77..f185575 100644 (file)
@@ -1,11 +1,8 @@
 (
-// TODO: for whatever reason when called from mac os,
-// every method here is executed 4 times
-
 ~samplerFactory = {
   var maxDur = 10.0;
   var sampler = Environment[
-    \version -> "33.7.2.3",
+    \version -> "33.7.4.1",
     \maxDur -> maxDur,
     \synthName -> \samplerPlay,
     \buf -> Buffer.alloc(s, s.sampleRate * maxDur, 1),
@@ -26,7 +23,6 @@
       Out.ar(out, sig!2);
     }).add,
     \startRec -> { |zi, pleiPich=false|
-      "startRec called".postln;
       zi.startPos = 0.0;
       zi.recSynth = Synth(\samplerRecord, [\input, s.inputBus, \buf, zi.buf], addAction: \addToTail);
       zi.endPos = s.sampleRate * 10;
@@ -39,7 +35,6 @@
     \startPos -> 0,
     \duration -> 0,
     \stopRec -> { |zi|
-      "stopRec called".postln;
       zi.duration = min(thisThread.seconds - zi.startTime, 10);
       zi.recSynth.free;
       if (zi.pleiPich, {
@@ -50,7 +45,6 @@
       });
     },
     \playSample -> { |zi|
-      "playSample called".postln;
       zi.playSynth = Synth(\samplerPlay,
         [\out, 0, \buf, zi.buf, \startPos, zi.startPos, \duration, zi.duration],
         addAction: \addToHead);
@@ -60,7 +54,6 @@
       zi.playSynth.set(\gate, 0);
     },
     \makeSynthBind -> { |zi|
-      "makeSynthBind called".postln;
       Pbind(
         \instrument, \samplerPlay,
         \buf, zi.buf,
@@ -69,7 +62,6 @@
       );
     },
     \makeSynthArgs -> { |zi|
-      "makeSynthArgs called".postln;
       [
         \buf, zi.buf,
         \startPos, zi.startPos,
@@ -78,7 +70,6 @@
     },
     \shiftPos -> { |zi, delta|
       var endPos = zi.startPos + zi.duration;
-      ("shiftPos called"++[delta, endPos, zi.startPos, zi.duration]).postln;
       zi.startPos = (zi.startPos + delta).clip(0, endPos);
       zi.duration = endPos - zi.startPos;
       zi.buf.loadToFloatArray(zi.startPos*zi.buf.sampleRate, zi.duration*zi.buf.sampleRate, action: { |array|