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

feat(controllers): add controller settings for the Numark Scratch #13402

Closed
Closed
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
21 changes: 9 additions & 12 deletions res/controllers/Numark-Scratch-scripts.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,33 @@ var NumarkScratch = {};

/*
* USER CONFIGURABLE SETTINGS.
* Change settings in the preferences
*/

// Defines the Beatloop Roll sizes for the 4 pads, for available values see:
// https://manual.mixxx.org/2.4/en/chapters/appendix/mixxx_controls.html#control-[ChannelN]-beatlooproll_X_activate
// Default: [0.25, 0.5, 1, 2]
NumarkScratch.autoLoopSizes = [
"0.25",
"0.5",
"1",
"2",
engine.getSetting("beatLoopRollsSize1") || 0.25,
engine.getSetting("beatLoopRollsSize2") || 0.5,
engine.getSetting("beatLoopRollsSize3") || 1,
engine.getSetting("beatLoopRollsSize4") || 2,
];

// Defines how the Loop Encoder functions.
// If 'true' the Encoder scrolls the library/loads track. Shift + Encoder manages looping.
// If 'false' the Encoder manages looping. Shift + Encoder scrolls the library/loads track (Serato default).
// Default: false
NumarkScratch.invertLoopEncoderFunction = false;
NumarkScratch.invertLoopEncoderFunction = !!engine.getSetting("invertLoopEncoderFunction");

// Defines the bightness of button LEDs when they inactive.
// '0x00' sets the LEDSs to completely off. '0x01 sets the LEDs to dim.
// Default: 0x01 (dim)
NumarkScratch.LOW_LIGHT = 0x01;
// Define whether or not to keep LEDs dimmed if they are inactive.
// 'true' will keep them dimmed, 'false' will turn them off. Default: true
components.Button.prototype.off = !!engine.getSetting("inactiveLightsAlwaysBacklit");

/*
* CODE
*/


components.Button.prototype.off = NumarkScratch.LOW_LIGHT;

NumarkScratch.init = function() {
// Initialize component containers
NumarkScratch.deck = new components.ComponentContainer();
Expand Down
96 changes: 93 additions & 3 deletions res/controllers/Numark-Scratch.midi.xml
Original file line number Diff line number Diff line change
@@ -1,12 +1,102 @@
<?xml version='1.0' encoding='utf-8'?>
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.3.0+">
<MixxxControllerPreset schemaVersion="1" mixxxVersion="2.4.0+">
<info>
<name>Numark Scratch</name>
<author>Al Hadebe(NotYourAverageAl)</author>
<description>Mapping for the Numark Scratch Mixer</description>
<forums>NumarkScratch</forums>
<manual>NumarkScratch</manual>
<forums>https://mixxx.discourse.group/t/numark-scratch-mapping/25186</forums>
<manual>numark_scratch</manual>
</info>
<settings>
<group label="Alternative Mapping">
<option
variable="invertLoopEncoderFunction"
type="boolean"
default="false"
label="Invert the Loop Encoder functionality">
<description>
By default the Encoder manages looping and Shift + Encoder scrolls the library/loads track.
If this option is selected the Encoder scrolls the library/loads track and Shift + Encoder manages looping.
</description>
</option>
</group>
<group label="Mixer Lighting">
<option
variable="inactiveLightsAlwaysBacklit"
type="boolean"
default="true"
label="Keep LEDs dimmed instead of off when inactive">
<description>
This will consistently ensure buttons are backlit, which can be helpful in low-light environments.
Please note the PAD MODE and CUE buttons are hardware controlled and always dim when inactive.
</description>
</option>
</group>
<group label="Beatloop Roll Size">
<row orientation="vertical">
<option
variable="beatLoopRollsSize1"
type="enum"
label="First Pad">
<value label="1/32">0.03125</value>
<value label="1/16">0.0625</value>
<value label="1/8">0.125</value>
<value label="1/4" default="true">0.25</value>
<value label="1/2">0.5</value>
<value label="1">1</value>
<value label="2">2</value>
<value label="4">4</value>
<value label="8">8</value>
<description>The first pad.</description>
</option>
<option
variable="beatLoopRollsSize2"
type="enum"
label="Second Pad">
<value label="1/32">0.03125</value>
<value label="1/16">0.0625</value>
<value label="1/8">0.125</value>
<value label="1/4">0.25</value>
<value label="1/2" default="true">0.5</value>
<value label="1">1</value>
<value label="2">2</value>
<value label="4">4</value>
<value label="8">8</value>
<description>The second pad.</description>
</option>
<option
variable="beatLoopRollsSize3"
type="enum"
label="Third Pad">
<value label="1/32">0.03125</value>
<value label="1/16">0.0625</value>
<value label="1/8">0.125</value>
<value label="1/4">0.25</value>
<value label="1/2">0.5</value>
<value label="1" default="true">1</value>
<value label="2">2</value>
<value label="4">4</value>
<value label="8">8</value>
<description>The third pad.</description>
</option>
<option
variable="beatLoopRollsSize4"
type="enum"
label="Fourth Pad">
<value label="1/32">0.03125</value>
<value label="1/16">0.0625</value>
<value label="1/8">0.125</value>
<value label="1/4">0.25</value>
<value label="1/2">0.5</value>
<value label="1">1</value>
<value label="2" default="true">2</value>
<value label="4">4</value>
<value label="8">8</value>
<description>The fourth pad.</description>
</option>
</row>
</group>
</settings>
<controller id="Numark-Scratch">
<scriptfiles>
<file functionprefix="" filename="lodash.mixxx.js"/>
Expand Down
Loading