diff options
author | Uwe Klotz <uklotz@mixxx.org> | 2020-06-12 22:16:35 +0200 |
---|---|---|
committer | Uwe Klotz <uklotz@mixxx.org> | 2020-06-12 22:16:35 +0200 |
commit | 8ec79dce6aff5973f3390a1583b1a19500b9f14d (patch) | |
tree | 90c7a2db2dc25dc31ba16132b0c5d3ed75000b21 | |
parent | 28fabbde43269ba3cfa7651450b22ab8ffe3b627 (diff) | |
parent | a55267aa95e63d6f1a6c4cb60953fb109ec57a44 (diff) |
Merge branch 'master' into coverart_color_and_digest
96 files changed, 4902 insertions, 310 deletions
diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 318f1cbcba..2d08bf81e2 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -39,12 +39,13 @@ # Using the `$SKIP` var is preferable to using `git commit --no-verify` # because it won't prevent catching other, unrelated issues. -exclude: ^(lib/|src/test/.*data/).*|res/translations/.*\.ts$ +# _anlz.h/_pdb.h: Header files generated by Kaitai Struct +exclude: ^(lib/|src/test/.*data/).*|res/translations/.*\.ts|src/.*_(anlz|pdb)\.h$ default_language_version: python: python3 repos: - repo: https://github.com/pre-commit/pre-commit-hooks - rev: v2.3.0 + rev: v3.1.0 hooks: - id: check-byte-order-marker exclude: ^.*(\.cbproj|\.groupproj|\.props|\.sln|\.vcxproj|\.vcxproj.filters)$ @@ -64,7 +65,7 @@ repos: - manual - id: no-commit-to-branch - repo: https://github.com/pre-commit/mirrors-eslint - rev: v6.8.0 + rev: v7.2.0 hooks: - id: eslint args: [--fix, --report-unused-disable-directives] @@ -90,7 +91,7 @@ repos: - id: black files: ^tools/.*$ - repo: https://gitlab.com/pycqa/flake8 - rev: '3.7.9' + rev: '3.8.3' hooks: - id: flake8 files: ^tools/.*$ diff --git a/.travis.yml b/.travis.yml index e8d2e29e3f..483e60dc89 100644 --- a/.travis.yml +++ b/.travis.yml @@ -35,7 +35,7 @@ jobs: directories: - $HOME/.cache/pre-commit before_install: - - pip install pre-commit==2.0.1 + - pip install pre-commit==2.5.1 script: - pre-commit run --all-files addons: [] @@ -48,7 +48,7 @@ jobs: directories: - $HOME/.cache/pre-commit before_install: - - pip install pre-commit==2.0.1 + - pip install pre-commit==2.5.1 script: - pre-commit run --origin HEAD --source origin/HEAD --show-diff-on-failure addons: [] diff --git a/CHANGELOG.md b/CHANGELOG.md index 62065463a3..9535a03ba4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -75,6 +75,11 @@ * Note: The old SCons build system is still supported for 2.3. We will be removing it for Mixxx 2.4. * Make Mixxx compile even though `QT_NO_OPENGL` or `QT_OPENGL_ES_2` is defined (fixes build on Raspberry Pi) [lp:1863440](https://bugs.launchpad.net/mixxx/+bug/1863440) [#2504](https://github.com/mixxxdj/mixxx/pull/2504) +## [2.2.5](https://launchpad.net/mixxx/+milestone/2.2.5) (Unreleased) + +* Add controller mapping for Hercules DJControl Inpulse 200 [#2542](https://github.com/mixxxdj/mixxx/pull/2542) +* Add controller mapping for Hercules DJControl Jogvision [#2370](https://github.com/mixxxdj/mixxx/pull/2370) + ## [2.2.4](https://launchpad.net/mixxx/+milestone/2.2.4) (Unreleased) * Store default recording format after "Restore Defaults" lp:1857806 #2414 diff --git a/res/controllers/Hercules-DJControl-Inpulse-200-script.js b/res/controllers/Hercules-DJControl-Inpulse-200-script.js new file mode 100644 index 0000000000..2b8a349d78 --- /dev/null +++ b/res/controllers/Hercules-DJControl-Inpulse-200-script.js @@ -0,0 +1,182 @@ +// DJControl_Inpulse_200_script.js +// +// *************************************************************************** +// * Mixxx mapping script file for the Hercules DJControl Inpulse 200. +// * Author: DJ Phatso, contributions by Kerrick Staley +// * Version 1.2 (March 2020) +// * Forum: https://www.mixxx.org/forums/viewtopic.php?f=7&t=12592 +// * Wiki: https://mixxx.org/wiki/doku.php/hercules_djcontrol_inpulse_200 +// +// Changes to v1.2 +// - Code cleanup. +// +// Changes to v1.1 +// - Fix seek-to-start and cue-master behavior. +// - Tweak scratch, seek, and bend behavior. +// - Controller knob/slider values are queried on startup, so MIXXX is synced. +// - Fixed vinyl button behavior the first time it's pressed. +// +// v1.0 : Original forum release +// +// TO DO: Functions that could be implemented to the script: +// +// FX: +// - See how to preselect effects for a rack +// +//************************************************************************* + +var DJCi200 = {}; +/////////////////////////////////////////////////////////////// +// USER OPTIONS // +/////////////////////////////////////////////////////////////// + +// How fast scratching is. +DJCi200.scratchScale = 1.0; + +// How much faster seeking (shift+scratch) is than scratching. +DJCi200.scratchShiftMultiplier = 4; + +// How fast bending is. +DJCi200.bendScale = 1.0; + +// Other scratch related options +DJCi200.kScratchActionNone = 0; +DJCi200.kScratchActionScratch = 1; +DJCi200.kScratchActionSeek = 2; +DJCi200.kScratchActionBend = 3; + +DJCi200.init = function() { + // Scratch button state + DJCi200.scratchButtonState = true; + // Scratch Action + DJCi200.scratchAction = { + 1: DJCi200.kScratchActionNone, + 2: DJCi200.kScratchActionNone + }; + + //Turn On Vinyl buttons LED(one for each deck). + midi.sendShortMsg(0x91, 0x03, 0x7F); + midi.sendShortMsg(0x92, 0x03, 0x7F); + + //Turn On Browser button LED + midi.sendShortMsg(0x90, 0x04, 0x05); + + //Softtakeover for Pitch fader + engine.softTakeover("[Channel1]", "rate", true); + engine.softTakeover("[Channel2]", "rate", true); + engine.softTakeoverIgnoreNextValue("[Channel1]", "rate"); + engine.softTakeoverIgnoreNextValue("[Channel2]", "rate"); + + //Set effects Levels - Dry/Wet + engine.setParameter("[EffectRack1_EffectUnit1_Effect1]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit1_Effect2]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit1_Effect3]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit2_Effect1]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit2_Effect2]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit2_Effect3]", "meta", 0.6); + engine.setParameter("[EffectRack1_EffectUnit1]", "mix", 1); + engine.setParameter("[EffectRack1_EffectUnit2]", "mix", 1); + + // Ask the controller to send all current knob/slider values over MIDI, which will update + // the corresponding GUI controls in MIXXX. + midi.sendShortMsg(0xB0, 0x7F, 0x7F); +}; + +// The Vinyl button, used to enable or disable scratching on the jog wheels (One per deck). +DJCi200.vinylButton = function(_channel, _control, value, status, _group) { + if (value) { + if (DJCi200.scratchButtonState) { + DJCi200.scratchButtonState = false; + midi.sendShortMsg(status, 0x03, 0x00); + } else { + DJCi200.scratchButtonState = true; + midi.sendShortMsg(status, 0x03, 0x7F); + } + } +}; + +DJCi200._scratchEnable = function(deck) { + var alpha = 1.0/8; + var beta = alpha/32; + engine.scratchEnable(deck, 248, 33 + 1/3, alpha, beta); +}; + +DJCi200._convertWheelRotation = function(value) { + // When you rotate the jogwheel, the controller always sends either 0x1 + // (clockwise) or 0x7F (counter clockwise). 0x1 should map to 1, 0x7F + // should map to -1 (IOW it's 7-bit signed). + return value < 0x40 ? 1 : -1; +}; + +// The touch action on the jog wheel's top surface +DJCi200.wheelTouch = function(channel, control, value, _status, _group) { + var deck = channel; + if (value > 0) { + // Touching the wheel. + if (engine.getValue("[Channel" + deck + "]", "play") !== 1 || DJCi200.scratchButtonState) { + DJCi200._scratchEnable(deck); + DJCi200.scratchAction[deck] = DJCi200.kScratchActionScratch; + } else { + DJCi200.scratchAction[deck] = DJCi200.kScratchActionBend; + } + } else { + // Released the wheel. + engine.scratchDisable(deck); + DJCi200.scratchAction[deck] = DJCi200.kScratchActionNone; + } +}; + +// The touch action on the jog wheel's top surface while holding shift +DJCi200.wheelTouchShift = function(channel, control, value, _status, _group) { + var deck = channel - 3; + // We always enable scratching regardless of button state. + if (value > 0) { + DJCi200._scratchEnable(deck); + DJCi200.scratchAction[deck] = DJCi200.kScratchActionSeek; + } else { + // Released the wheel. + engine.scratchDisable(deck); + DJCi200.scratchAction[deck] = DJCi200.kScratchActionNone; + } +}; + +// Scratching on the jog wheel (rotating it while pressing the top surface) +DJCi200.scratchWheel = function(channel, control, value, status, _group) { + var deck; + switch (status) { + case 0xB1: + case 0xB4: + deck = 1; + break; + case 0xB2: + case 0xB5: + deck = 2; + break; + default: + return; + } + var interval = DJCi200._convertWheelRotation(value); + var scratchAction = DJCi200.scratchAction[deck]; + if (scratchAction === DJCi200.kScratchActionScratch) { + engine.scratchTick(deck, interval * DJCi200.scratchScale); + } else if (scratchAction === DJCi200.kScratchActionSeek) { + engine.scratchTick(deck, + interval * DJCi200.scratchScale * + DJCi200.scratchShiftMultiplier); + } else { + engine.setValue( + "[Channel" + deck + "]", "jog", interval * DJCi200.bendScale); + } +}; + +// Bending on the jog wheel (rotating using the edge) +DJCi200.bendWheel = function(channel, control, value, _status, _group) { + var interval = DJCi200._convertWheelRotation(value); + engine.setValue( + "[Channel" + channel + "]", "jog", interval * DJCi200.bendScale); +}; + +DJCi200.shutdown = function() { + midi.sendShortMsg(0xB0, 0x7F, 0x7E); + midi.sendShortMsg(0x90, 0x04, 0x00); +}; diff --git a/res/controllers/Hercules_DJControl_Inpulse_200.midi.xml b/res/controllers/Hercules_DJControl_Inpulse_200.midi.xml new file mode 100644 index 0000000000..1b87f171e7 --- /dev/null +++ b/res/controllers/Hercules_DJControl_Inpulse_200.midi.xml @@ -0,0 +1,1802 @@ +<?xml version="1.0" encoding="UTF-8"?> +<MixxxMIDIPreset mixxxVersion="2.2" schemaVersion="1"> + <info> + <name>Hercules DJControl Inpulse 200</name> + <author>DJ Phatso for Hercules Technical Support</author> + <description>MIDI Preset for Hercules DJControl Inpulse 200</description> + <wiki>https://www.mixxx.org/wiki/doku.php/hercules_djcontrol_inpulse_200</wiki> + <forums>https://www.mixxx.org/forums/viewtopic.php?f=7&t=12592</forums> + </info> + <controller id="DJControl Inpulse 200"> + <scriptfiles> + <file filename="lodash.mixxx.js" /> + <file filename="midi-components-0.0.js" /> + <file functionprefix="DJCi200" filename="Hercules-DJControl-Inpulse-200-script.js" /> + </scriptfiles> + <controls> + <!--Note Number (NN) - Buttons/switches/Encoders --> + <!-- NN's MIDI Channel 1 (0x90)--> + <!--Browser section (Encoder button)--> + <control> + <group>[Library]</group> + <key>MoveFocus</key> + <description>Browser button</description> + <status>0x90</status> + |