Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

controllers: fix waveform_zoom ranges #12393

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading