From: Eugene Petkevich Date: Tue, 7 Jun 2022 16:50:43 +0000 (+0300) Subject: Add optional dict argument to bind X-Git-Url: https://git.zuelum.org/?a=commitdiff_plain;h=f5de11ddfcace5244a54d0faa996dd346a17d8b6;p=scprojects.git Add optional dict argument to bind --- diff --git a/extensions/classes/midibind.sc b/extensions/classes/midibind.sc index 159ee85..ec82b63 100644 --- a/extensions/classes/midibind.sc +++ b/extensions/classes/midibind.sc @@ -3,8 +3,8 @@ {|d| this.get(param, { |v| var newVal = v*((d)/divisor).midiratio; - "%: % = %\n".postf(this, param, newVal); this.set(param, newVal); + "%: % = %\n".postf(this, param, newVal); }); } } @@ -13,8 +13,8 @@ {|d| this.get(param, { |v| var newVal = v+(d/divisor); - "%: % = %\n".postf(this, param, newVal); this.set(param, newVal); + "%: % = %\n".postf(this, param, newVal); }); } } @@ -22,17 +22,19 @@ bindRange {|param, start, end| {|v| var newVal = v.linlin(0, 1, start, end); - "%: % = %\n".postf(this, param, newVal); this.set(param, newVal); + "%: % = %\n".postf(this, param, newVal); } } - bindWarp {|param, warp=(\lin.asWarp)| + bindWarp {|param, warp=(\lin.asWarp), dict=nil| warp = warp.asWarp; {|v| var newVal = warp.map(v); - "%: % = %\n".postf(this, param, newVal); this.set(param, newVal); + "%: % = %\n".postf(this, param, newVal); + dict !? {dict[param] = newVal;}; } } + } \ No newline at end of file