Skip to content

Commit

Permalink
chore: Add encoder assignments to function buttons in X-Touch One script
Browse files Browse the repository at this point in the history
  • Loading branch information
bjoluc committed Mar 31, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent e93589b commit 11011e5
Showing 2 changed files with 40 additions and 2 deletions.
4 changes: 3 additions & 1 deletion readme.md
Original file line number Diff line number Diff line change
@@ -172,7 +172,9 @@ Current limitations of the MIDI Remote API:
<summary>X-Touch One</summary>

- The X-Touch One script does not provide a `devices` config option. If you want to use an X-Touch One with an extender, please use the X-Touch One script and the X-Touch script separately.
- Since the X-Touch One does not have encoder assign buttons, the push encoder always controls the selected channel's panorama (unless overridden by user mappings).
- The X-Touch One does not have encoder assign buttons. To make up for this, the F1 and F2 buttons are mapped to cycle through the following encoder assignments:
- F1: Pan, Monitor, Pre Gain, Low-Cut Frequency / Enabled, High-Cut Frequency / Enabled
- F2: Send levels/active 1-3

</details>

38 changes: 37 additions & 1 deletion src/device-configs/behringer_xtouch-one.ts
Original file line number Diff line number Diff line change
@@ -7,7 +7,7 @@ import { DeviceConfig } from ".";
import { JogWheel } from "/decorators/surface-elements/JogWheel";
import { Lamp } from "/decorators/surface-elements/Lamp";
import { LedButton } from "/decorators/surface-elements/LedButton";
import { LedPushEncoder } from "/decorators/surface-elements/LedPushEncoder";
import { EncoderDisplayMode, LedPushEncoder } from "/decorators/surface-elements/LedPushEncoder";
import { TouchSensitiveMotorFader } from "/decorators/surface-elements/TouchSensitiveFader";
import { createElements } from "/util";

@@ -162,4 +162,40 @@ export const deviceConfig: DeviceConfig = {
},
};
},

configureEncoderAssignments(defaultEncoderMapping, page) {
return [
// Pan, Monitor, Gain, LC, HC (F1)
{
activatorButtonSelector: (device) => device.controlSectionElements.buttons.function[0],
pages: [
...[...defaultEncoderMapping[0].pages, ...defaultEncoderMapping[1].pages].filter((page) =>
["Pan", "Monitor", "Input Gain", "Low Cut", "High Cut"].includes(page.name),
),
],
},

// Sends 1-3 (F2)
{
activatorButtonSelector: (device) => device.controlSectionElements.buttons.function[1],
pages: createElements(3, (slotId) => {
return {
name: `Send Slot`,
assignments: (channel) => {
const sendSlot = channel.mSends.getByIndex(slotId);

return {
encoderValue: sendSlot.mLevel,
encoderValueName: `Send ${slotId + 1}`,
displayMode: EncoderDisplayMode.SingleDot,
encoderValueDefault: 0.7890865802764893,
pushToggleValue: sendSlot.mOn,
};
},
areAssignmentsChannelRelated: true,
};
}),
},
];
},
};

0 comments on commit 11011e5

Please sign in to comment.