From: Eugene Petkevich Date: Mon, 30 May 2022 17:58:15 +0000 (+0300) Subject: Fix load and button2 / add reveal callback X-Git-Url: https://git.zuelum.org/?a=commitdiff_plain;h=aa878e6fa8fe09f5b30e4a450a210e0482c67d17;p=scprojects.git Fix load and button2 / add reveal callback --- diff --git a/extensions/classes/midimix.sc b/extensions/classes/midimix.sc index 2298c63..5de6ad5 100644 --- a/extensions/classes/midimix.sc +++ b/extensions/classes/midimix.sc @@ -5,6 +5,7 @@ MidiMix { var reveal = false; // channel selector var <>chanrot; // modes @@ -12,7 +13,7 @@ MidiMix { // wheel rotation var <>jogrot, <>scratch; // buttons - var <>lpfA, <>lpfB, <>but1, <>but1, <>select, <>sync, <>play, <>cue, <>deck, <>rotbut1, <>rotbut2, <>rotbutload, <>jogact; + var <>lpfA, <>lpfB, <>but1, <>but2, <>select, <>sync, <>play, <>cue, <>deck, <>rotbut1, <>rotbut2, <>rotbutload, <>jogact; // knobs var <>again, <>bgain, <>ahi, <>amid, <>alow, <>bhi, <>bmid, <>blow; // faders @@ -55,8 +56,8 @@ MidiMix { 8 -> \cue, 9 -> \deck, 11 -> \rotbut1, - 12 -> \rotbut2, - 13 -> \rotbutload, + 12 -> \rotbutload, + 13 -> \rotbut2, 21 -> \jogact, ]; } @@ -65,6 +66,12 @@ MidiMix { ^super.newCopyArgs(name).prInit; } + noCallback {|handlerName...args| + if (reveal) { + "%.%(%)".format(this.name, handlerName, args).postln; + }; + } + prInit { var dest = MIDIClient.destinations.detect({ |item| item.device == "Mix-101" @@ -188,6 +195,20 @@ MidiMix { handler.value(false, *args); }, controlNotes.keys.asArray, srcID: idin); + // initialize handlers with revealing code + [ + \chanrot, \sampler, \loop, \fx, \vinyl, \jogrot, \scratch, + \lpfA, \lpfB, \but1, \but2, \select, \sync, \play, \cue, \deck, + \rotbut1, \rotbut2, \rotbutload, \jogact, + \again, \bgain, \ahi, \amid, \alow, \bhi, \bmid, \blow, + \afade, \bfade, \crossfade, + \rot1, \rot2, \rotload + ].do{|handlerName| + this.perform((handlerName++\_).asSymbol, {|...args| + this.noCallback(handlerName, *args); + }); + }; + // == Starter message and animation //this.animate; "Шаҫиху готов к использованию 😊".postln;