From 0e1c677e07ba2d3416419a5e414f9f117856ace0 Mon Sep 17 00:00:00 2001 From: Peter Molnar Date: Thu, 23 Aug 2012 10:07:31 +0200 Subject: [PATCH] v0.4 --- Hercules DJ Control MP3.midi.xml | 11 +++++++++++ Hercules-DJ-Control-MP3-scripts.js | 31 ++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/Hercules DJ Control MP3.midi.xml b/Hercules DJ Control MP3.midi.xml index 23d647b..d7d473a 100644 --- a/Hercules DJ Control MP3.midi.xml +++ b/Hercules DJ Control MP3.midi.xml @@ -381,6 +381,17 @@ + + + 0xb0 + 0x39 + [Playlist] + HerculesMP3.playlist + + + + + diff --git a/Hercules-DJ-Control-MP3-scripts.js b/Hercules-DJ-Control-MP3-scripts.js index a7c5a7f..6b30580 100644 --- a/Hercules-DJ-Control-MP3-scripts.js +++ b/Hercules-DJ-Control-MP3-scripts.js @@ -584,3 +584,34 @@ HerculesMP3.wheelDecay = function (value) { } } }; + + +HerculesMP3.playlist = function (group, control, value, status) { + if (HerculesMP3.debug) print ("[Debug] HerculesMP3.playlist (" + group +", "+ control +", "+value +", "+status +")" ); + print ("[Debug] HerculesMP3.playlist (" + group +", "+ control +", "+value +", "+status +")" ); + // 7F > 40: CCW Slow > Fast - 127 > 64 + // 01 > 3F: CW Slow > Fast - 0 > 63 + + //knobValue = value >=0x40 ? value - 0x80 : value; // -64 to +63, - = CCW, + = CW + //if (value >=0x40 ) + if (value ==127 ) + engine.setValue("[Playlist]","SelectNextTrack", 1); + else if (value ==5 ) + engine.setValue("[Playlist]","SelectPrevTrack", 1); + + //engine.setValue([Playlist],"scratch", (engine.getValue(group,"scratch") + (jogValue/64)).toFixed(2)); + + // do some scratching + //if (HerculesMP3.scratchMode) + //{ + // if (HerculesMP3.debug) print("Do scratching value:" + value + " jogValue: " + jogValue ); + // engine.setValue(group,"scratch", (engine.getValue(group,"scratch") + (jogValue/64)).toFixed(2)); + //} + //// do pitch adjustment + //else + //{ + // newValue = jogValue; + // if (HerculesMP3.debug) print("do pitching adjust " + jogValue + " new Value: " + newValue); + // engine.setValue(group,"jog", newValue); + //} +}; \ No newline at end of file