From: Eugene Petkevich Date: Sun, 8 May 2022 19:51:18 +0000 (+0300) Subject: Start/stop by pressing button X-Git-Url: https://git.zuelum.org/?a=commitdiff_plain;h=946d79070d47ca3a6d0a6c79be95bd9c011226a6;p=scprojects.git Start/stop by pressing button --- diff --git a/push-control.scd b/push-control.scd index cfd718a..c5d68a8 100644 --- a/push-control.scd +++ b/push-control.scd @@ -210,15 +210,14 @@ // The following is working by itself, // but factory function assignment to global var // returns nil - /* - try { + /*try { // linux push.pushOut = MIDIOut.newByName("Ableton Push", "Ableton Push MIDI 2"); }{ // mac os push.pushOut = MIDIOut.newByName("Ableton Push", "User Port"); - }; - */ + };*/ + push.pushOut.latency_(0); if (push.pushOut==nil, {"Cannot control push LEDs!"}); diff --git a/test.scd b/test.scd index 47a77fc..322efd9 100644 --- a/test.scd +++ b/test.scd @@ -7,13 +7,20 @@ ~se.makeSynthEvent ~se.makeSynthArgs +~recording = false; ( ~push.recDown = { |zi| - ~se.startRec(); + if (~recording, { + ~se.stopRec(); + ~recording = false; + }, { + ~se.startRec(); + ~recording = true; + }); }; ~push.recUp = { |zi| - ~se.stopRec(); + //~se.stopRec(); }; ~push.playDown = { |zi| ~se.playSample(); @@ -28,8 +35,7 @@ var note, amp; ~push.padLight(row, col, 2, 1, false, 0); note = Scale.major.degreeToFreq(col, 0.midicps, row+1); - amp = vel.linlin(1, 127, 0.01, 0.4); - Synth(~se.synthName, ~se.makeSynthArgs++[\freq, note]); + Synth(~se.synthName, ~se.makeSynthArgs++[\freq, note, \amp, vel]); }; ~push.padUp = { |zi, row, col, vel| ~push.padLight(row, col, 0, 0, false, 1);