Skip to content

Commit

Permalink
fixed bank and channel switching
Browse files Browse the repository at this point in the history
  • Loading branch information
Bannsaenger committed May 31, 2021
1 parent 550017b commit 1ac32cb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion main.js
Original file line number Diff line number Diff line change
Expand Up @@ -806,7 +806,7 @@ class XTouch extends utils.Adapter {
const logObj = self.calculateFaderValue(self.deviceGroups[faderId + '.value'].val, 'linValue');

if (typeof realChannel === 'undefined') realChannel = '9'; // only if Master Fader
const statusByte = 0xE0 + Number(realChannel)-1;
const statusByte = 0xE0 + Number(channelInBank)-1;
const dataByte2 = Math.floor(Number(logObj.midiValue) / 128).toFixed(0);
const dataByte1 = Math.floor(Number(logObj.midiValue) - (Number(dataByte2) * 128)).toFixed(0);
const midiCommand = new Uint8Array([statusByte, Number(dataByte1), Number(dataByte2)]);
Expand Down

0 comments on commit 1ac32cb

Please sign in to comment.