From fc203e1f730d4215738a2b09499c80f57413efed Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Sat, 16 Feb 2019 19:57:05 +0100 Subject: [PATCH 1/2] added velocity sensitive option to components samplerbutton --- res/controllers/midi-components-0.0.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 4e5dec43d168..2c39bc577775 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -308,6 +308,7 @@ print('ERROR: No sampler number specified for new SamplerButton.'); return; } + this.velocity = options.velocity; this.number = options.number; this.group = '[Sampler' + this.number + ']'; Button.call(this, options); @@ -319,6 +320,9 @@ if (engine.getValue(this.group, 'track_loaded') === 0) { engine.setValue(this.group, 'LoadSelectedTrack', 1); } else { + if (this.velocity) { + engine.setValue(this.group, 'volume', this.inValueScale(value)); + } engine.setValue(this.group, 'cue_gotoandplay', 1); } } From 4071e4f2c16871bc2eaf2e11e4fe555943a2ce69 Mon Sep 17 00:00:00 2001 From: Swiftb0y <12380386+Swiftb0y@users.noreply.github.com> Date: Sat, 23 Feb 2019 13:53:41 +0100 Subject: [PATCH 2/2] Renamed velocity to volumeByVelocity. --- res/controllers/midi-components-0.0.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/res/controllers/midi-components-0.0.js b/res/controllers/midi-components-0.0.js index 2c39bc577775..4e16c80ccf10 100644 --- a/res/controllers/midi-components-0.0.js +++ b/res/controllers/midi-components-0.0.js @@ -308,7 +308,7 @@ print('ERROR: No sampler number specified for new SamplerButton.'); return; } - this.velocity = options.velocity; + this.volumeByVelocity = options.volumeByVelocity; this.number = options.number; this.group = '[Sampler' + this.number + ']'; Button.call(this, options); @@ -320,7 +320,7 @@ if (engine.getValue(this.group, 'track_loaded') === 0) { engine.setValue(this.group, 'LoadSelectedTrack', 1); } else { - if (this.velocity) { + if (this.volumeByVelocity) { engine.setValue(this.group, 'volume', this.inValueScale(value)); } engine.setValue(this.group, 'cue_gotoandplay', 1);