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

Hercules Inpulse 300: add toneplay, slicer, and beatmatch functionalities #14073

Merged
merged 58 commits into from
Dec 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
58 commits
Select commit Hold shift + click to select a range
c474332
Edited authors
BoredGuy1 Jan 3, 2024
8defca2
Edited to-do
BoredGuy1 Jan 3, 2024
9825290
Fixed syntax
BoredGuy1 Jan 3, 2024
52b0b6a
Fixed syntax (again)
BoredGuy1 Jan 3, 2024
090fb66
Fixed syntax (yet again)
BoredGuy1 Jan 3, 2024
25872c8
More fixed syntax
BoredGuy1 Jan 3, 2024
348ce39
More fixed syntax
BoredGuy1 Jan 3, 2024
2409adf
Replaced let with var (for some reason let causes errors)
BoredGuy1 Jan 3, 2024
6cde971
Finally fixed spelling (thanks pre-commit)
BoredGuy1 Jan 3, 2024
3ecb6f3
Added sampler stopping and toneplay
BoredGuy1 Jan 3, 2024
dddcfec
Added JS to toneplay
BoredGuy1 Jan 25, 2024
62473fe
Changed scratching, fixed LED issue
BoredGuy1 Jan 28, 2024
8512fbe
Changed the way toneplay LED works
BoredGuy1 Jan 29, 2024
1a6938c
Added slicer/slicer loop
BoredGuy1 Feb 2, 2024
d53eeb7
Added shift+toneplay controls
BoredGuy1 Feb 3, 2024
159080e
Fixed VU meters
BoredGuy1 Feb 3, 2024
644f320
Added beatmatch guide
BoredGuy1 Feb 3, 2024
24b02c8
Fixed scratching, rearranged shift+toneplay functions
BoredGuy1 Feb 4, 2024
39181e9
Rearranged shift+toneplay functions
BoredGuy1 Mar 15, 2024
2fa4587
Rearranged shift+toneplay functions
BoredGuy1 Mar 16, 2024
6a4d9bd
Fixed slicer
BoredGuy1 May 13, 2024
712d8d7
Fixed formatting for real thanks to ESLint
BoredGuy1 May 13, 2024
0711585
Fixed formatting and ESLint (hopefully for the last time)
BoredGuy1 May 15, 2024
1c47ed7
Changed how toneplay + shift works
BoredGuy1 Jul 29, 2024
52ececf
Changed XML to account for loop hotcues
BoredGuy1 Jul 29, 2024
ea64399
Fixed XML version (which I broke 6 months ago)
BoredGuy1 Jul 29, 2024
fa9ec9a
Fixed scratching issue FINALLY (hopefully for real)
BoredGuy1 Oct 5, 2024
934594c
Fixed scratching issue for real
BoredGuy1 Oct 5, 2024
2b7e034
Replaced vuMeterUpdateMaster with vuMeterUpdateMain
BoredGuy1 Nov 8, 2024
3e1b19f
Changed pad mode values and changed slicerButtons to boolean
BoredGuy1 Nov 8, 2024
d177a7d
Consolidated connections with for statement
BoredGuy1 Nov 12, 2024
09e724f
changed recentHotcue
BoredGuy1 Nov 12, 2024
19eac9c
changed VU meter syntax
BoredGuy1 Nov 12, 2024
03719ef
changed hotcue_X_enabled to hotcue_X_status
BoredGuy1 Nov 12, 2024
01efd39
Replaced stuff with script.deckFromGroup
BoredGuy1 Nov 12, 2024
28845a9
Replaced separate slicer variables with dictionary declaration
BoredGuy1 Nov 12, 2024
6ef2f3f
Merge branch 'main' of https://github.com/BoredGuy1/mixxx
BoredGuy1 Nov 12, 2024
50dedba
Replaced some more numbers with booleans
BoredGuy1 Nov 12, 2024
0d67d18
Replaced Master with Main
BoredGuy1 Nov 12, 2024
b2a2637
Fixed some slicer variables
BoredGuy1 Nov 12, 2024
bbb3e89
Fixed small channel mistake
BoredGuy1 Nov 12, 2024
3f4d3ef
replaced decks with groups
BoredGuy1 Nov 27, 2024
6e17182
reworked toneplay, updated comment about framerate
BoredGuy1 Nov 27, 2024
b9ea27b
removed useless helper function
BoredGuy1 Nov 28, 2024
1f08832
reworked slicer a bit
BoredGuy1 Nov 28, 2024
6c3cce7
Packed Slicer into components
BoredGuy1 Dec 20, 2024
b4dd4b7
Increased beatmatch tolerances by a bit
BoredGuy1 Dec 20, 2024
4347516
Fixed minor error on comment
BoredGuy1 Dec 20, 2024
3fa91b5
Reverted beatmatch code slightly
BoredGuy1 Dec 20, 2024
081df3b
Tested code, fixed ESLint issues
BoredGuy1 Dec 20, 2024
b7597a9
Fixed even more ESLint issues
BoredGuy1 Dec 20, 2024
dde38dc
3rd time's the charm
BoredGuy1 Dec 23, 2024
e96ab3a
Increased beatmatch tolerances by a bit
BoredGuy1 Dec 20, 2024
4ff3a1b
Merge branch 'main' of https://github.com/BoredGuy1/mixxx
BoredGuy1 Dec 23, 2024
e038ad5
Fixed some bugs with Toneplay and edge cases with Slicer
BoredGuy1 Dec 24, 2024
77d0144
Added missing functionality to Hercules Inpulse 300 script
BoredGuy1 Jan 3, 2024
866a70b
Merge branch 'inpulse' of https://github.com/BoredGuy1/mixxx into inp…
BoredGuy1 Dec 25, 2024
b302951
Merge branch 'inpulse' of https://github.com/BoredGuy1/mixxx into inp…
BoredGuy1 Dec 29, 2024
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
23 changes: 14 additions & 9 deletions res/controllers/Hercules-DJControl-Inpulse-300-script.js
Original file line number Diff line number Diff line change
Expand Up @@ -388,17 +388,16 @@ DJCi300.changeMode = function(_channel, control, value, _status, group) {

// Toneplay
DJCi300.toneplay = function(_channel, control, value, _status, group) {
const button = control - 0x40 + 1;
let button = control - 0x40;

if (value) {
// Pad buttons (buttons 1-8) will jump to a hotcue and change pitch
// Shift + pad buttons (buttons 9-16) will only change pitch without jumping
if (button <= 8) {
if (button < 8) {
// Jump to the most recently used hotcue
const recentHotcue = engine.getValue(group, "hotcue_focus");
if ((recentHotcue > 0) && (engine.getValue(group,
`hotcue_${ recentHotcue }_status`) > 0)) {

engine.setValue(group, `hotcue_${ recentHotcue }_goto`, 1);
} else {
// If that hotcue doesn't exist or was deleted, jump to cue
Expand All @@ -407,13 +406,15 @@ DJCi300.toneplay = function(_channel, control, value, _status, group) {
}
}

// Subtract 8 from buttons if they're shifted
button = (button < 8) ? button : button - 8;
// Adjust pitch
if (button <= 4) {
if (button < 4) {
// Buttons 1-4 are +0 to +3 semitones
engine.setValue(group, "pitch", button - 1);
engine.setValue(group, "pitch", button);
// Buttons 5-8 are -4 to -1 semitones
} else {
engine.setValue(group, "pitch", button - 9);
engine.setValue(group, "pitch", button - 8);
}
}
};
Expand Down Expand Up @@ -521,6 +522,8 @@ DJCi300.Deck = function(deckNumber) {
engine.setValue(group, "loop_end_position", this.slicerPad[7].endSample);
if (DJCi300.padMode[group] === DJCi300.padModeSlicer) {
if (engine.getValue(group, "loop_enabled") === 1) { engine.setValue(group, "reloop_toggle", 1); }
} else if (DJCi300.padMode[group] === DJCi300.padModeSlicerloop) {
if (engine.getValue(group, "loop_enabled") === 0) { engine.setValue(group, "reloop_toggle", 1); }
}
};
}.bind(this),
Expand All @@ -531,17 +534,17 @@ DJCi300.Deck = function(deckNumber) {
// Much like before, everything in the if-statement only needs to be done once (not 8 times)
if (i === 0) {
const group = this.currentDeck;
// Disconnect callback functions if they are connected
// Disconnect slicer if it is connected
if (this.slicerPad.beatConnection !== undefined && this.slicerPad.beatConnection.isConnected === true) {
this.slicerPad.beatConnection.disconnect();
this.slicerPad.sizeConnection.disconnect();
this.slicerPad.loadConnection.disconnect();
this.slicerPad.beat = -1;
this.slicerUpdateLED(group);
}
// Make loop position indicators disappear as visual feedback
engine.setValue(group, "loop_start_position", -1);
engine.setValue(group, "loop_end_position", -1);
this.slicerUpdateLED(group);
}
}.bind(this),
input: function(_channel, control, value, _status, group) {
Expand Down Expand Up @@ -575,7 +578,9 @@ DJCi300.Deck = function(deckNumber) {

// Disable the loop (if we're not in slicer loop mode)
if (DJCi300.padMode[group] === DJCi300.padModeSlicer) {
engine.setValue(group, "reloop_toggle", 1);
if (engine.getValue(group, "loop_enabled") === 1) { engine.setValue(group, "reloop_toggle", 1); }
} else if (DJCi300.padMode[group] === DJCi300.padModeSlicerloop) {
if (engine.getValue(group, "loop_enabled") === 0) { engine.setValue(group, "reloop_toggle", 1); }
}
}
this.slicerUpdateLED(group);
Expand Down
146 changes: 145 additions & 1 deletion res/controllers/Hercules_DJControl_Inpulse_300.midi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@
<control>
<group>[Channel2]</group>
<key>loop_double</key>
<description>SHIFT + Loop Ou: Loop Double</description>
<description>SHIFT + Loop Out: Loop Double</description>
<status>0x95</status>
<midino>0x0A</midino>
<options>
Expand Down Expand Up @@ -4148,6 +4148,150 @@
<midino>0x37</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler1]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 1 DECK A)</description>
<status>0x96</status>
<midino>0x38</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler9]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 1 DECK B)</description>
<status>0x97</status>
<midino>0x38</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler2]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 2 DECK A)</description>
<status>0x96</status>
<midino>0x39</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler10]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 2 DECK B)</description>
<status>0x97</status>
<midino>0x39</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler3]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 3 DECK A)</description>
<status>0x96</status>
<midino>0x3A</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler11]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 3 DECK B)</description>
<status>0x97</status>
<midino>0x3A</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler4]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 4 DECK A)</description>
<status>0x96</status>
<midino>0x3B</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler12]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 4 DECK B)</description>
<status>0x97</status>
<midino>0x3B</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler5]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 5 DECK A)</description>
<status>0x96</status>
<midino>0x3C</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler13]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 5 DECK B)</description>
<status>0x97</status>
<midino>0x3C</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler6]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 6 DECK A)</description>
<status>0x96</status>
<midino>0x3D</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler14]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 6 DECK B)</description>
<status>0x97</status>
<midino>0x3D</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler7]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 7 DECK A)</description>
<status>0x96</status>
<midino>0x3E</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler15]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 7 DECK B)</description>
<status>0x97</status>
<midino>0x3E</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler8]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 8 DECK A)</description>
<status>0x96</status>
<midino>0x3F</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<output>
<group>[Sampler16]</group>
<key>play_indicator</key>
<description>(SHIFT + Pad 4 DECK B)</description>
<status>0x97</status>
<midino>0x3F</midino>
<on>0x7F</on>
<minimum>0.5</minimum>
</output>
<!--LED BEATJUMP-->
<output>
Expand Down
Loading