Skip to content

Commit

Permalink
Merge pull request #12842 from grizeldi/flx4-improvements
Browse files Browse the repository at this point in the history
Pioneer DDJ-FLX4 mapping improvements
  • Loading branch information
Swiftb0y authored Feb 18, 2024
2 parents dc8470f + 860576b commit 909ab3c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 22 deletions.
12 changes: 11 additions & 1 deletion res/controllers/Pioneer-DDJ-FLX4-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,11 @@ PioneerDDJFLX4.lights = {
// Store timer IDs
PioneerDDJFLX4.timers = {};

// Keep alive timer
PioneerDDJFLX4.sendKeepAlive = function() {
midi.sendSysexMsg([0xF0, 0x00, 0x40, 0x05, 0x00, 0x00, 0x04, 0x05, 0x00, 0x50, 0x02, 0xf7], 12); // This was reverse engineered with Wireshark
};

// Jog wheel constants
PioneerDDJFLX4.vinylMode = true;
PioneerDDJFLX4.alpha = 1.0/8;
Expand Down Expand Up @@ -265,8 +270,10 @@ PioneerDDJFLX4.init = function() {
}
engine.makeConnection("[EffectRack1_EffectUnit1]", "focused_effect", PioneerDDJFLX4.toggleFxLight);

PioneerDDJFLX4.keepAliveTimer = engine.beginTimer(200, PioneerDDJFLX4.sendKeepAlive);

// query the controller for current control positions on startup
midi.sendSysexMsg([0xF0, 0x00, 0x40, 0x05, 0x00, 0x00, 0x02, 0x06, 0x00, 0x03, 0x01, 0xf7], 12);
PioneerDDJFLX4.sendKeepAlive(); // the query seems to double as a keep alive message
};

//
Expand Down Expand Up @@ -807,4 +814,7 @@ PioneerDDJFLX4.shutdown = function() {
// stop any flashing lights
PioneerDDJFLX4.toggleLight(PioneerDDJFLX4.lights.beatFx, false);
PioneerDDJFLX4.toggleLight(PioneerDDJFLX4.lights.shiftBeatFx, false);

// stop the keepalive timer
engine.stopTimer(PioneerDDJFLX4.keepAliveTimer);
};
21 changes: 0 additions & 21 deletions res/controllers/Pioneer-DDJ-FLX4.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -930,27 +930,6 @@
<fourteen-bit-msb/>
</options>
</control>

<control>
<description>HEADPHONES LEVEL - rotate - Headphone gain</description>
<group>[Master]</group>
<key>headGain</key>
<status>0xB6</status>
<midino>0x2D</midino>
<options>
<fourteen-bit-lsb/>
</options>
</control>
<control>
<description>HEADPHONES LEVEL - rotate - Headphone gain</description>
<group>[Master]</group>
<key>headGain</key>
<status>0xB6</status>
<midino>0x0D</midino>
<options>
<fourteen-bit-msb/>
</options>
</control>
<!-- MIXER Section END -->

<!-- EFFECT Section START -->
Expand Down

0 comments on commit 909ab3c

Please sign in to comment.