From f5de11ddfcace5244a54d0faa996dd346a17d8b6 Mon Sep 17 00:00:00 2001 From: Eugene Petkevich Date: Tue, 7 Jun 2022 19:50:43 +0300 Subject: [PATCH] Add optional dict argument to bind --- extensions/classes/midibind.sc | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 -- 2.17.1