From 04e1f6685fc8d4fa43e5e6ee4f729223cbdb050e Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Wed, 27 Feb 2019 22:54:52 +0100 Subject: [PATCH 1/2] Force components.SamplerButton volume to max when not velocity sensitive --- res/controllers/midi-components-0.0.js | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 4e16c80ccf10..ff04974af626 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -320,9 +320,13 @@ if (engine.getValue(this.group, 'track_loaded') === 0) { engine.setValue(this.group, 'LoadSelectedTrack', 1); } else { - if (this.volumeByVelocity) { - engine.setValue(this.group, 'volume', this.inValueScale(value)); - } + engine.setValue( + this.group, + 'volume', + this.volumeByVelocity ? + this.inValueScale(value) : + 1 + ); engine.setValue(this.group, 'cue_gotoandplay', 1); } } From 2b0cc5ecd7862a6e32b03f742830c01011165c85 Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Fri, 1 Mar 2019 22:43:46 +0100 Subject: [PATCH 2/2] removed volume change on press and reset the volume on disconnect instead --- res/controllers/midi-components-0.0.js | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index ff04974af626..ccab8c2f70a7 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -320,13 +320,6 @@ if (engine.getValue(this.group, 'track_loaded') === 0) { engine.setValue(this.group, 'LoadSelectedTrack', 1); } else { - engine.setValue( - this.group, - 'volume', - this.volumeByVelocity ? - this.inValueScale(value) : - 1 - ); engine.setValue(this.group, 'cue_gotoandplay', 1); } } @@ -380,6 +373,15 @@ this.connections[2] = engine.connectControl(this.group, 'repeat', this.output); } }, + disconnect: function () { + // reset volume to initial volume + engine.setParameter(this.group,"volume",1); + if (this.connections[0] !== undefined) { + this.connections.forEach(function (conn) { + conn.disconnect(); + }); + } + }, outKey: null, // hack to get Component constructor to call connect() });