diff --git a/res/controllers/Ion Discover DJ.midi.xml b/res/controllers/Ion Discover DJ.midi.xml index 0aaa8a665c03..0868dd6d8f0d 100644 --- a/res/controllers/Ion Discover DJ.midi.xml +++ b/res/controllers/Ion Discover DJ.midi.xml @@ -1,396 +1,444 @@ - - - - Ion Discover DJ - Rick Prokup - This preset provides functionality for the Ion Discover DJ controller for Mixxx - http://www.mixxx.org/forums/viewtopic.php?f=7&t=939 - - - - - - - - - 0x90 - 0x43 - [Channel1] - IonDiscoverDJ.volCh1Down - - - - - - 0x90 - 0x44 - [Channel1] - IonDiscoverDJ.volCh1Up - - - - - - 0x90 - 0x45 - [Channel2] - IonDiscoverDJ.volCh2Down - - - - - - 0x90 - 0x46 - [Channel2] - IonDiscoverDJ.volCh2Up - - - - - - 0xb0 - 0x11 - [Channel2] - filterHigh - - - - - - 0xb0 - 0x10 - [Channel1] - filterHigh - - - - - - 0x90 - 0x47 - [Channel2] - beatsync - - - - - - 0x90 - 0x40 - [Channel1] - beatsync - - - - - - 0xb0 - 0x14 - [Channel1] - filterMid - - - - - - 0xb0 - 0x15 - [Channel2] - filterMid - - - - - - 0xb0 - 0x17 - [Master] - volume - - - - - - - - 0x80 - 0x42 - [Channel2] - IonDiscoverDJ.pflCh2Off - - - - - - 0x80 - 0x3b - [Channel1] - IonDiscoverDJ.pflCh1Off - - - - - - 0x90 - 0x42 - [Channel2] - IonDiscoverDJ.pflCh2On - - - - - - 0x90 - 0x3b - [Channel1] - IonDiscoverDJ.pflCh1On - - - - - - 0xb0 - 0x1a - [Playlist] - SelectTrackKnob - - - - - - 0x90 - 0x4f - [Playlist] - LoadSelectedIntoFirstStopped - - - - - - 0x80 - 0x4a - [Channel1] - play - - - - - - 0x80 - 0x4c - [Channel2] - play - - - - - - 0x90 - 0x4a - [Channel1] - play - - - - - - 0x90 - 0x4c - [Channel2] - play - - - - - - 0x90 - 0x33 - [Channel1] - IonDiscoverDJ.reversek - - - - - - 0x90 - 0x3c - [Channel2] - IonDiscoverDJ.reversek - - - - - - 0x80 - 0x33 - [Channel1] - IonDiscoverDJ.reversek - - - - - - 0x80 - 0x3c - [Channel2] - IonDiscoverDJ.reversek - - - - - - 0x90 - 0x34 - [Channel2] - IonDiscoverDJ.LoadSelectedTrackCh2 - - - - - - 0x90 - 0x4b - [Channel1] - IonDiscoverDJ.LoadSelectedTrackCh1 - - - - - - 0xb0 - 0x8 - [Channel1] - filterLow - - - - - - - 0xb0 - 0x9 - [Channel2] - filterLow - - - - - - 0xb0 - 0xa - [Master] - crossfader - - - - - - 0x90 - 0x48 - [Channel1] - IonDiscoverDJ.toggle_scratch_mode_on - - - - - - 0x80 - 0x48 - [Channel1] - IonDiscoverDJ.toggle_scratch_mode_off - - - - - - - 0x90 - 0x4d - [Channel1] - IonDiscoverDJ.jog_touch - - - - - - 0x80 - 0x4d - [Channel1] - IonDiscoverDJ.jog_touch - - - - - - 0x90 - 0x4e - [Channel2] - IonDiscoverDJ.jog_touch - - - - - - 0x80 - 0x4e - [Channel2] - IonDiscoverDJ.jog_touch - - - - - - - 0xb0 - 0x19 - [Channel1] - IonDiscoverDJ.jog_wheel - - - - - - 0xb0 - 0x18 - [Channel2] - IonDiscoverDJ.jog_wheel - - - - - - - - + + + + Ion Discover DJ + Rick Prokup + This preset provides functionality for the Ion Discover DJ controller for Mixxx + http://www.mixxx.org/forums/viewtopic.php?f=7&t=939 + + + + + + + + [Master] + maximize_library + MIDI Learned from 2 messages. + 0x90 + 0x4F + + + + + + [Channel2] + filterLow + 0xB0 + 0x09 + + + + + + [Channel1] + IonDiscoverDJ.toggle_scratch_mode_off + 0x80 + 0x48 + + + + + + [Channel1] + reverse + MIDI Learned from 6 messages. + 0x90 + 0x33 + + + + + + [Channel1] + filterMid + 0xB0 + 0x14 + + + + + + [Channel2] + cue_default + MIDI Learned from 4 messages. + 0x80 + 0x42 + + + + + + [Channel1] + IonDiscoverDJ.jog_touch + 0x80 + 0x4D + + + + + + [Channel1] + rate_perm_down + MIDI Learned from 6 messages. + 0x90 + 0x43 + + + + + + [Channel1] + IonDiscoverDJ.jog_wheel + 0xB0 + 0x19 + + + + + + [Channel2] + reverse + MIDI Learned from 8 messages. + 0x80 + 0x3C + + + + + + [Channel2] + IonDiscoverDJ.jog_touch + 0x90 + 0x4E + + + + + + [Channel1] + filterLow + 0xB0 + 0x08 + + + + + + [Channel2] + sync_enabled + MIDI Learned from 10 messages. + 0x80 + 0x47 + + + + + + [Channel1] + IonDiscoverDJ.toggle_scratch_mode_on + 0x90 + 0x48 + + + + + + [Channel2] + play + 0x80 + 0x4C + + + + + + [Channel2] + cue_default + MIDI Learned from 4 messages. + 0x90 + 0x42 + + + + + + [Channel2] + IonDiscoverDJ.jog_wheel + 0xB0 + 0x18 + + + + + + [Channel1] + cue_default + MIDI Learned from 2 messages. + 0x80 + 0x3B + + + + + + [Channel1] + IonDiscoverDJ.jog_touch + 0x90 + 0x4D + + + + + + [Channel2] + rate_perm_up + MIDI Learned from 8 messages. + 0x80 + 0x46 + + + + + + [Channel2] + reverse + MIDI Learned from 8 messages. + 0x90 + 0x3C + + + + + + [Channel2] + sync_enabled + MIDI Learned from 10 messages. + 0x90 + 0x47 + + + + + + [Channel1] + sync_enabled + MIDI Learned from 2 messages. + 0x80 + 0x40 + + + + + + [Master] + volume + 0xB0 + 0x17 + + + + + + [Channel2] + play + 0x90 + 0x4C + + + + + + [Channel2] + rate_perm_down + MIDI Learned from 10 messages. + 0x80 + 0x45 + + + + + + [Channel1] + cue_default + MIDI Learned from 2 messages. + 0x90 + 0x3B + + + + + + [Channel2] + filterHigh + 0xB0 + 0x11 + + + + + + [Channel2] + rate_perm_up + MIDI Learned from 8 messages. + 0x90 + 0x46 + + + + + + [Channel1] + play + 0x80 + 0x4A + + + + + + [Channel1] + sync_enabled + MIDI Learned from 2 messages. + 0x90 + 0x40 + + + + + + [Channel1] + IonDiscoverDJ.LoadSelectedTrackCh1 + 0x90 + 0x4B + + + + + + [Channel1] + rate_perm_up + MIDI Learned from 4 messages. + 0x80 + 0x44 + + + + + + [Channel1] + filterHigh + 0xB0 + 0x10 + + + + + + [Master] + maximize_library + MIDI Learned from 2 messages. + 0x80 + 0x4F + + + + + + [Channel1] + reverse + MIDI Learned from 6 messages. + 0x80 + 0x33 + + + + + + [Channel2] + rate_perm_down + MIDI Learned from 10 messages. + 0x90 + 0x45 + + + + + + [Channel2] + IonDiscoverDJ.LoadSelectedTrackCh2 + 0x90 + 0x34 + + + + + + [Master] + crossfader + 0xB0 + 0x0A + + + + + + [Channel2] + filterMid + 0xB0 + 0x15 + + + + + + [Channel1] + play + 0x90 + 0x4A + + + + + + [Channel1] + rate_perm_down + MIDI Learned from 6 messages. + 0x80 + 0x43 + + + + + + [Channel2] + IonDiscoverDJ.jog_touch + 0x80 + 0x4E + + + + + + [Channel1] + rate_perm_up + MIDI Learned from 4 messages. + 0x90 + 0x44 + + + + + + [Playlist] + SelectTrackKnob + 0xB0 + 0x1A + + + + + + + + diff --git a/res/controllers/Ion-Discover-DJ-scripts.js b/res/controllers/Ion-Discover-DJ-scripts.js index faaa4deb73ae..c10171b3ab95 100644 --- a/res/controllers/Ion-Discover-DJ-scripts.js +++ b/res/controllers/Ion-Discover-DJ-scripts.js @@ -37,6 +37,15 @@ IonDiscoverDJ.init = function (id) { // called when the MIDI device is opened IonDiscoverDJ.sendMidi(0x80, IonDiscoverDJ.leds[LED], IonDiscoverDJ.ledOff, timeToWait); timeToWait += 5; } + + engine.connectControl("[Channel1]", "play_indicator", "IonDiscoverDJ.PlayLED"); + engine.connectControl("[Channel2]", "play_indicator", "IonDiscoverDJ.PlayLED"); + engine.connectControl("[Channel1]", "cue_indicator", "IonDiscoverDJ.CueLED"); + engine.connectControl("[Channel2]", "cue_indicator", "IonDiscoverDJ.CueLED"); + engine.connectControl("[Channel1]", "beat_active", "IonDiscoverDJ.SyncLED"); + engine.connectControl("[Channel2]", "beat_active", "IonDiscoverDJ.SyncLED"); + engine.connectControl("[Channel1]", "reverse", "IonDiscoverDJ.RevLED"); + engine.connectControl("[Channel2]", "reverse", "IonDiscoverDJ.RevLED"); }; IonDiscoverDJ.sendMidi = function(status, control, value, timeToWait) { @@ -61,9 +70,9 @@ IonDiscoverDJ.Deck.prototype.jogMove = function(jogValue) { var newRate = engine.getValue(this.group, "rate") + (jogValue/3000); engine.setValue(this.group, "rate", newRate); } else if(this.scratching) { - engine.scratchTick(this.deckNumber, jogValue); + engine.scratchTick(this.deckNumber, jogValue/3); } else { - jogValue = jogValue * 10; + jogValue = jogValue *10; engine.setValue(this.group,"jog", jogValue); } }; @@ -106,20 +115,6 @@ IonDiscoverDJ.toggle_scratch_mode_on = function (control, value, status) { } } -IonDiscoverDJ.toggle_scratch_mode_off = function (control, value, status) { - //IonDiscoverDJ.scratchMode = false; - //midi.sendShortMsg(0x80, IonDiscoverDJ.leds["scratch"] , IonDiscoverDJ.ledOff); -} - -IonDiscoverDJ.play = function (control, value, status) { - // Only send events when play is pushed, not when it comes back up. - // group = IonDiscoverDJ.getGroup(control); - // if (engine.getValue(group, "duration") == 0) { if (value) print("No song on " + group); return; }; - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds[IonDiscoverDJ.getGroup(control) + " play"], IonDiscoverDJ.ledOn); - // midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] play"], IonDiscoverDJ.ledOn); - // engine.setValue(group,"play", !engine.getValue(group,"play")); - // if (engine.getValue(group, "play") == 0) midi.sendShortMsg(0x80, IonDiscoverDJ.leds[group + " play"], IonDiscoverDJ.ledOFF); -} IonDiscoverDJ.jog_touch = function (channel, control, value, status, group) { var deck = IonDiscoverDJ.GetDeck(group); @@ -173,44 +168,57 @@ IonDiscoverDJ.pflCh1Off = function (group, control, value, status) {} IonDiscoverDJ.pflCh2On = function (group, control, value, status) { if(engine.getValue("[Channel2]", "pfl")){ engine.setValue("[Channel2]","pfl", false); - midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] cue"], IonDiscoverDJ.ledOff);} + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] cue"], IonDiscoverDJ.ledOff); + } else { engine.setValue("[Channel2]","pfl", true); - midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] cue"], IonDiscoverDJ.ledOn);} - } -IonDiscoverDJ.pflCh2Off = function (group, control, value, status) {} + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] cue"], IonDiscoverDJ.ledOn); + }} -IonDiscoverDJ.LoadSelectedTrackCh1 = function (group, control, value, status) -{ - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] play"], IonDiscoverDJ.ledOn); +IonDiscoverDJ.LoadSelectedTrackCh1 = function (group, control, value, status) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] play"], IonDiscoverDJ.ledOn); engine.setValue("[Channel1]","LoadSelectedTrack", true); - - //IonDiscoverDJ.pauseScript(5000); - //engine.setValue("[Channel1]","play", true); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] play"], IonDiscoverDJ.ledOff); - - //IonDiscoverDJ.pauseScript(5000); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] sync"], IonDiscoverDJ.ledOn); - //IonDiscoverDJ.pauseScript(200); - //engine.setValue("[Channel1]","beatsync", true); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel1] sync"], IonDiscoverDJ.ledOff); } -IonDiscoverDJ.LoadSelectedTrackCh2 = function (group, control, value, status) -{ - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] play"], IonDiscoverDJ.ledOn); +IonDiscoverDJ.LoadSelectedTrackCh2 = function (group, control, value, status) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] play"], IonDiscoverDJ.ledOn); engine.setValue("[Channel2]","LoadSelectedTrack", true); - - //IonDiscoverDJ.pauseScript(5000); - //engine.setValue("[Channel2]","play", true); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] play"], IonDiscoverDJ.ledOff); - - //IonDiscoverDJ.pauseScript(5000); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] sync"], IonDiscoverDJ.ledOn); - //IonDiscoverDJ.pauseScript(200); - //engine.setValue("[Channel2]","beatsync", true); - //midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel2] sync"], IonDiscoverDJ.ledOff); } +IonDiscoverDJ.PlayLED = function (value, group, control) { + var deck = IonDiscoverDJ.GetDeck(group); + if(value) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] play"], IonDiscoverDJ.ledOn); + } else { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] play"], IonDiscoverDJ.ledOff); + } +} + +IonDiscoverDJ.CueLED = function (value, group, control) { + var deck = IonDiscoverDJ.GetDeck(group); + if(value) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] cue"], IonDiscoverDJ.ledOn); + } else { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] cue"], IonDiscoverDJ.ledOff); + } +} + +IonDiscoverDJ.SyncLED = function (value, group, control) { + var deck = IonDiscoverDJ.GetDeck(group); + if(value) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] sync"], IonDiscoverDJ.ledOn); + } else { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] sync"], IonDiscoverDJ.ledOff); + } +} + +IonDiscoverDJ.RevLED = function (value, group, control) { + var deck = IonDiscoverDJ.GetDeck(group); + if(value) { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] rev"], IonDiscoverDJ.ledOn); + } else { + midi.sendShortMsg(0x90, IonDiscoverDJ.leds["[Channel" + deck.deckNumber +"] rev"], IonDiscoverDJ.ledOff); + } +}