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

Pioneer DDJ-400: make Beat FX section more intuitive #10912

Merged
merged 2 commits into from
Mar 20, 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
47 changes: 30 additions & 17 deletions res/controllers/Pioneer-DDJ-400-script.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Pioneer-DDJ-400-script.js
// ****************************************************************************
// * Mixxx mapping script file for the Pioneer DDJ-400.
// * Authors: Warker, nschloe, dj3730, jusko
// * Authors: Warker, nschloe, dj3730, jusko, tiesjan
// * Reviewers: Be-ing, Holzhaus
// * Manual: https://manual.mixxx.org/2.3/en/hardware/controllers/pioneer_ddj_400.html
// ****************************************************************************
Expand All @@ -19,22 +19,21 @@
//
// Custom (Mixxx specific mappings):
// * BeatFX: Assigned Effect Unit 1
// < LEFT focus EFFECT1
// > RIGHT focus EFFECT2
// v FX_SELECT focus EFFECT3.
// < LEFT toggles focus between Effects 1, 2 and 3 leftward
// > RIGHT toggles focus between Effects 1, 2 and 3 rightward
// v DOWN loads next effect entry for focused Effect
// SHIFT + v UP loads previous effect entry for focused Effect
// LEVEL/DEPTH controls the Mix knob of the Effect Unit
// SHIFT + LEVEL/DEPTH controls the Meta knob of the focused Effect
// ON/OFF toggles focused effect slot
// SHIFT + ON/OFF disables all three effect slots.
// SHIFT + < loads previous effect
// SHIFT + > loads next effect
//
// * 32 beat jump forward & back (Shift + </> CUE/LOOP CALL arrows)
// * Toggle quantize (Shift + channel cue)
//
// Not implemented (after discussion and trial attempts):
// * Loop Section:
// * -4BEAT auto loop (hacky---prefer a clean way to set a 4 beat loop
// from a previous position on long press)
//
// * CUE/LOOP CALL - memory & delete (complex and not useful. Hot cues are sufficient)
//
// * Secondary pad modes (trial attempts complex and too experimental)
Expand Down Expand Up @@ -243,30 +242,44 @@ PioneerDDJ400.beatFxLevelDepthRotate = function(_channel, _control, value) {
}
};

PioneerDDJ400.beatFxSelectPreviousEffect = function(_channel, _control, value) {
engine.setValue(PioneerDDJ400.focusedFxGroup(), "prev_effect", value);
};
PioneerDDJ400.changeFocusedEffectBy = function(numberOfSteps) {
var focusedEffect = engine.getValue("[EffectRack1_EffectUnit1]", "focused_effect");

PioneerDDJ400.beatFxSelectNextEffect = function(_channel, _control, value) {
engine.setValue(PioneerDDJ400.focusedFxGroup(), "next_effect", value);
// Convert to zero-based index
focusedEffect -= 1;

// Standard Euclidean modulo by use of two plain modulos
var numberOfEffectsPerEffectUnit = 3;
focusedEffect = (((focusedEffect + numberOfSteps) % numberOfEffectsPerEffectUnit) + numberOfEffectsPerEffectUnit) % numberOfEffectsPerEffectUnit;

// Convert back to one-based index
focusedEffect += 1;

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", focusedEffect);
};

PioneerDDJ400.beatFxLeftPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 1);
PioneerDDJ400.changeFocusedEffectBy(-1);
};

PioneerDDJ400.beatFxRightPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 2);
PioneerDDJ400.changeFocusedEffectBy(1);
};

PioneerDDJ400.beatFxSelectPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue("[EffectRack1_EffectUnit1]", "focused_effect", 3);
engine.setValue(PioneerDDJ400.focusedFxGroup(), "next_effect", value);
};

PioneerDDJ400.beatFxSelectShiftPressed = function(_channel, _control, value) {
if (value === 0) { return; }

engine.setValue(PioneerDDJ400.focusedFxGroup(), "prev_effect", value);
};

PioneerDDJ400.beatFxOnOffPressed = function(_channel, _control, value) {
Expand Down Expand Up @@ -426,7 +439,7 @@ PioneerDDJ400.syncLongPressed = function(channel, control, value, status, group)
};

PioneerDDJ400.cycleTempoRange = function(_channel, _control, value, _status, group) {
if (value === 0) return; // ignore release
if (value === 0) { return; } // ignore release

var currRange = engine.getValue(group, "rateRange");
var idx = 0;
Expand Down
30 changes: 10 additions & 20 deletions res/controllers/Pioneer-DDJ-400.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<MixxxMIDIPreset schemaVersion="1" mixxxVersion="2.2">
<info>
<name>Pioneer DDJ-400</name>
<author>Warker/nschloe/dj3730/jusko</author>
<author>Warker, nschloe, dj3730, jusko, tiesjan</author>
<description>Midi Mapping for the Pioneer DDJ-400</description>
<manual>pioneer_ddj_400</manual>
<forums>https://mixxx.discourse.group/t/pioneer-ddj-400/17476</forums>
Expand Down Expand Up @@ -998,7 +998,7 @@
<!-- BEAT FX SECTION START -->

<control>
<description>BEAT LEFT - press - select effect unit 1</description>
<description>BEAT LEFT - press - toggle focused Effect leftward</description>
<group>[EffectRack1_EffectUnit1]</group>
<key>PioneerDDJ400.beatFxLeftPressed</key>
<status>0x94</status>
Expand All @@ -1007,19 +1007,9 @@
<Script-Binding/>
</options>
</control>
<control>
<description>BEAT LEFT + shift - select previous effect for the current unit</description>
<group>[EffectRack1_EffectUnit1]</group>
<key>PioneerDDJ400.beatFxSelectPreviousEffect</key>
<status>0x94</status>
<midino>0x66</midino>
<options>
<Script-Binding/>
</options>
</control>

<control>
<description>BEAT RIGHT - press - select effect unit 2</description>
<description>BEAT RIGHT - press - toggle focused Effect rightward</description>
<group>[EffectRack1_EffectUnit1]</group>
<key>PioneerDDJ400.beatFxRightPressed</key>
<status>0x94</status>
Expand All @@ -1028,23 +1018,23 @@
<Script-Binding/>
</options>
</control>

<control>
<description>BEAT RIGHT + shift - select next effect for the current unit</description>
<description>BEAT FX SELECT - press - load next effect entry for focused Effect</description>
<group>[EffectRack1_EffectUnit1]</group>
<key>PioneerDDJ400.beatFxSelectNextEffect</key>
<key>PioneerDDJ400.beatFxSelectPressed</key>
<status>0x94</status>
<midino>0x6B</midino>
<midino>0x63</midino>
Swiftb0y marked this conversation as resolved.
Show resolved Hide resolved
<options>
<Script-Binding/>
</options>
</control>

<control>
<description>BEAT FX SELECT - press once - select effect unit 3 - press again - clear focus back to wet/dry mix </description>
<description>BEAT FX SELECT +SHIFT - press - load previous effect entry for focused Effect</description>
<group>[EffectRack1_EffectUnit1]</group>
<key>PioneerDDJ400.beatFxSelectPressed</key>
<key>PioneerDDJ400.beatFxSelectShiftPressed</key>
<status>0x94</status>
<midino>0x63</midino>
<midino>0x64</midino>
<options>
<Script-Binding/>
</options>
Expand Down