Skip to content

Commit

Permalink
Merge pull request #12393 from ronso0/waveform-zoom-mappings
Browse files Browse the repository at this point in the history
controllers: fix `waveform_zoom` ranges
  • Loading branch information
JoergAtGithub authored Dec 4, 2023
2 parents 40d23f3 + 854b315 commit 9eda4c3
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 11 deletions.
7 changes: 4 additions & 3 deletions res/controllers/KANE_QuNeo_scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -888,7 +888,8 @@ KANE_QuNeo.closeSliderMode = function () {
KANE_QuNeo.deckZoom = function (deck, value) {
var channel = deck - 1; // track channels start at 0 to properly reference arrays
var channelName = KANE_QuNeo.getChannelName(deck)
var normalized = Math.ceil(6 * ((127 - value) / 127))
// range is 1..10
var normalized = Math.ceil(9 * ((127 - value) / 127)) + 1;
// adjust zoom
engine.setValue(channelName, "waveform_zoom", normalized)
}
Expand Down Expand Up @@ -2347,8 +2348,8 @@ KANE_QuNeo.masterVuMeter = function (value) {
// Sliders
KANE_QuNeo.deckZoomLEDs = function (deck, value) {
var LEDGroup = KANE_QuNeo.getLEDGroup(deck);
// normalize zoom LED value to be 0-127
var zoom = ((value - 1) / 5) * 127
// normalize zoom LED value to be 0-127, range is 1..10
var zoom = ((value - 1) / 9) * 127
// determine which control we are manipulating
var control = KANE_QuNeo.getSliderControl(deck, 0)
// emit message
Expand Down
8 changes: 4 additions & 4 deletions res/controllers/Korg-nanoKONTROL-2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -506,9 +506,9 @@ NK2.toggleBinaryControlAll = function toggleBinaryControlAll(control){
NK2.wavezoomAll = function wavezoomAll(value){
if (NK2.debug>2){print("##function: "+NK2.getFunctionName())};

var range=6-1;
var range=10-1;
var newValue=Math.round(1+((value/127)*range));
if (newValue>6)newValue=6;
if (newValue>10)newValue=10;
if (newValue<1)newValue=1;
if (NK2.lastwavevalue!=value){
for (var i=1; i<9; i++){
Expand All @@ -522,9 +522,9 @@ NK2.wavezoomDeck = function wavezoomDeck(value, group){
if (NK2.debug>2){print("##function: "+NK2.getFunctionName())};
if (group=="default"){group=NK2.Deck[NK2.curDeck];};

var range=6-1;
var range=10-1;
var newValue=Math.round(1+((value/127)*range));
if (newValue>6)newValue=6;
if (newValue>10)newValue=10;
if (newValue<1)newValue=1;
if (NK2.lastwavevalue!=value){
engine.setValue(group, "waveform_zoom", newValue);
Expand Down
2 changes: 1 addition & 1 deletion res/controllers/Novation-Launchpad MK2-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@ var NLMK2 = (function () {
waveform_zoom: {
group: `[${type}${i}]`,
name: 'waveform_zoom',
type: '1.0 - 6.0'
type: '1.0 - 10.0'
},
waveform_zoom_up: {
group: `[${type}${i}]`,
Expand Down
2 changes: 1 addition & 1 deletion res/controllers/Novation-Launchpad Mini MK3-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@ var NLMMK3 = (function () {
waveform_zoom: {
group: `[${type}${i}]`,
name: 'waveform_zoom',
type: '1.0 - 6.0'
type: '1.0 - 10.0'
},
waveform_zoom_up: {
group: `[${type}${i}]`,
Expand Down
3 changes: 2 additions & 1 deletion res/controllers/Novation-Launchpad-Mini-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,8 @@ function ZoomKey(dir) {
that.onPushOrig = that.onPush;
that.onPush = function()
{
if ( ZoomKey.zoom < 6 && this.dir == "+" ) {
// range is 1..10
if ( ZoomKey.zoom < 10 && this.dir == "+" ) {
ZoomKey.zoom++;
}
if ( ZoomKey.zoom > 1 && this.dir == "-") {
Expand Down
2 changes: 1 addition & 1 deletion res/controllers/Novation-Launchpad-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -4410,7 +4410,7 @@ var NLMK1 = (function () {
waveform_zoom: {
group: `[${type}${i}]`,
name: 'waveform_zoom',
type: '1.0 - 6.0'
type: '1.0 - 10.0'
},
waveform_zoom_up: {
group: `[${type}${i}]`,
Expand Down

0 comments on commit 9eda4c3

Please sign in to comment.