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

Device Channels for MIDI Always Set to 1 #18

Open
sbmechanics opened this issue Mar 10, 2017 · 5 comments
Open

Device Channels for MIDI Always Set to 1 #18

sbmechanics opened this issue Mar 10, 2017 · 5 comments
Assignees

Comments

@sbmechanics
Copy link

sbmechanics commented Mar 10, 2017

In Configuration > Devices, the channel for a given device always sets to 1. See the screenshots below (Device 1 as Channel 1, Device 8 as Channel 8 > SYX file shows Device 1 as Channel 1, Device 8 as Channel 1).
capture
capture1

@markphilpot markphilpot self-assigned this Mar 10, 2017
@sbmechanics
Copy link
Author

It appears that line 700 of main.js ( gcp.config.deviceChannels[dNum] = 1;) is setting the channel to 1 for any active device, and that a UI change of the Channel does not change the relevant gcp.config.deviceChannels[dNum].

@sbmechanics
Copy link
Author

This issue affects the Program Offset setting for Devices as well.

@sbmechanics
Copy link
Author

Potential fix: add following code below line 721 in main.js:

$d.find('.deviceChannel').change(function(){
gcp.config.deviceChannels[dNum] = +$(this).val();
}).val(gcp.config.deviceChannels[dNum]);

$d.find('.deviceProgramOffset').change(function(){
gcp.config.deviceProgramOffsets[dNum] = +$(this).val();
}).val(gcp.config.deviceProgramOffsets[dNum]);

@sbmechanics
Copy link
Author

Unsure if this is related to these changes, and I can open a separate issue if you want. On a blank / new config (imported syx files are not affected), Preset 0 always starts with all devices disabled, and starts with the PC number for all devices as 1. Incrementing up starts at Preset 1, which will also have all devices set to PC but enables (see picture). For new configs, my guess is that all device on Preset 0 should be enabled (for consistency purposes), and that the incrementing should start with Preset 0, at 0 or 1 depending on the Program Offset for the device in Configuration > Devices. The trick would be not to have a preset PC change if editing to the preset had already been done and the Program Offset subsequently changed.
capture

@sbmechanics
Copy link
Author

sbmechanics commented Mar 10, 2017

Increment issue drop-in fix would be to change line 499 in gcp.js to
this.presets[i].deviceProgramChanges[j].pc = (i%128);
from
this.presets[i].deviceProgramChanges[j].pc = (i%128) - 1;
and commenting out lines 496 and 501 in gcp.js.

Looking at the GCP board itself, best option may be to simply increment from 1 on all devices, starting at preset 1, regardless of Program Offset, and default all devices on. (Which matches the changes above, but all of it needs a second look.)
The more that I look at this, and the way that it can renumber Program Changes on an existing config whenever a device is added / removed or the Program Offset is changed, the more that I'm thinking the entire if / for loop (496-502 in gcp.js) should be commented out, letting the user number the PC and select device on / off as they see fit. The risk of custom presets getting renumbered is high. The same would likely apply for renumbering that occurs elsewhere in the code for a change to the Program Offset setting. The downside would be that most people are likely moving through Program Changes in presets sequentially from 0-127 or 1-128 when creating a config. Thoughts?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants