diff options
-rw-r--r-- | Midi_Interface/rhmixxx_midi_controller_MIDI_1-scripts.js | 288 |
1 files changed, 285 insertions, 3 deletions
diff --git a/Midi_Interface/rhmixxx_midi_controller_MIDI_1-scripts.js b/Midi_Interface/rhmixxx_midi_controller_MIDI_1-scripts.js index 91ef0f7..84b5815 100644 --- a/Midi_Interface/rhmixxx_midi_controller_MIDI_1-scripts.js +++ b/Midi_Interface/rhmixxx_midi_controller_MIDI_1-scripts.js @@ -37,6 +37,21 @@ RHMixxx.init = function () { //RHMixxx.FlashAllLED(); //Connect Control engine.connectControl("[Channel1]", "play", "RHMixxx.Channel1_playing"); + engine.connectControl("[Channel2]", "play", "RHMixxx.Channel2_playing"); + engine.connectControl("[Sampler1]", "play", "RHMixxx.Sampler1_playing"); + engine.connectControl("[Sampler2]", "play", "RHMixxx.Sampler2_playing"); + engine.connectControl("[Sampler3]", "play", "RHMixxx.Sampler3_playing"); + engine.connectControl("[Sampler4]", "play", "RHMixxx.Sampler4_playing"); + engine.connectControl("[Sampler5]", "play", "RHMixxx.Sampler5_playing"); + engine.connectControl("[Sampler6]", "play", "RHMixxx.Sampler6_playing"); + engine.connectControl("[Sampler7]", "play", "RHMixxx.Sampler7_playing"); + engine.connectControl("[Sampler8]", "play", "RHMixxx.Sampler8_playing"); + engine.connectControl("[Sampler9]", "play", "RHMixxx.Sampler9_playing"); + engine.connectControl("[Sampler10]", "play", "RHMixxx.Sampler10_playing"); + engine.connectControl("[Sampler11]", "play", "RHMixxx.Sampler11_playing"); + engine.connectControl("[Sampler12]", "play", "RHMixxx.Sampler12_playing"); + + engine.connectControl("[Channel1]", "play_indicator", "RHMixxx.Channel1_playing"); } RHMixxx.shutdown = function () { @@ -46,7 +61,7 @@ RHMixxx.shutdown = function () { /////////////////////////// // // // Functions // -// // +// setting leds // // // /////////////////////////// @@ -56,12 +71,31 @@ RHMixxx.Channel1_playing = function (channel, control, value, status, group) { var currentlyPlaying = engine.getValue("[Channel1]","play"); if (currentlyPlaying == 0){ //engine.setValue("[Channel1]","play",1); - midi.sendShortMsg(0x80,0x09,0x00); + midi.sendShortMsg(0x80,0x01,0x00); } else { if (currentlyPlaying == 1){ //engine.setValue("[Channel1]","play",0); - midi.sendShortMsg(0x90,0x09,0x00); + midi.sendShortMsg(0x90,0x01,0x00); + } + + } +} +engine.trigger("[Channel1]","play"); +} + +RHMixxx.Channel2_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Channel2]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Channel2]","play",1); + midi.sendShortMsg(0x80,0x03,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Channel2]","play",0); + midi.sendShortMsg(0x90,0x03,0x00); } } @@ -69,6 +103,254 @@ RHMixxx.Channel1_playing = function (channel, control, value, status, group) { engine.trigger("[Channel2]","play"); } +RHMixxx.Sampler1_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler1]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler1]","play",1); + midi.sendShortMsg(0x80,0x04,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler1]","play",0); + midi.sendShortMsg(0x90,0x04,0x00); + } + + } +} +engine.trigger("[Sampler1]","play"); +} + +RHMixxx.Sampler2_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler2]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler2]","play",1); + midi.sendShortMsg(0x80,0x05,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler2]","play",0); + midi.sendShortMsg(0x90,0x05,0x00); + } + + } +} +engine.trigger("[Sampler2]","play"); +} + +RHMixxx.Sampler3_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler3]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler3]","play",1); + midi.sendShortMsg(0x80,0x06,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler3]","play",0); + midi.sendShortMsg(0x90,0x06,0x00); + } + + } +} +engine.trigger("[Sampler3]","play"); +} + +RHMixxx.Sampler4_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler4]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler4]","play",1); + midi.sendShortMsg(0x80,0x07,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler4]","play",0); + midi.sendShortMsg(0x90,0x07,0x00); + } + + } +} +engine.trigger("[Sampler4]","play"); +} + +RHMixxx.Sampler5_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler5]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler5]","play",1); + midi.sendShortMsg(0x80,0x08,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler5]","play",0); + midi.sendShortMsg(0x90,0x08,0x00); + } + + } +} +engine.trigger("[Sampler5]","play"); +} + +RHMixxx.Sampler6_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler6]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler6]","play",1); + midi.sendShortMsg(0x80,0x09,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler6]","play",0); + midi.sendShortMsg(0x90,0x09,0x00); + } + + } +} +engine.trigger("[Sampler6]","play"); +} + +RHMixxx.Sampler7_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler7]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler7]","play",1); + midi.sendShortMsg(0x80,0x0a,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler7]","play",0); + midi.sendShortMsg(0x90,0x0a,0x00); + } + + } +} +engine.trigger("[Sampler7]","play"); +} + +RHMixxx.Sampler8_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler8]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler8]","play",1); + midi.sendShortMsg(0x80,0x0b,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler8]","play",0); + midi.sendShortMsg(0x90,0x0b,0x00); + } + + } +} +engine.trigger("[Sampler8]","play"); +} + +RHMixxx.Sampler9_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler9]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler9]","play",1); + midi.sendShortMsg(0x80,0x0c,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler9]","play",0); + midi.sendShortMsg(0x90,0x0c,0x00); + } + + } +} +engine.trigger("[Sampler9]","play"); +} + +RHMixxx.Sampler10_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler10]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler10]","play",1); + midi.sendShortMsg(0x80,0x0d,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler10]","play",0); + midi.sendShortMsg(0x90,0x0d,0x00); + } + + } +} +engine.trigger("[Sampler10]","play"); +} + +RHMixxx.Sampler11_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler11]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler11]","play",1); + midi.sendShortMsg(0x80,0x0e,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler11]","play",0); + midi.sendShortMsg(0x90,0x0e,0x00); + } + + } +} +engine.trigger("[Sampler11]","play"); +} + +RHMixxx.Sampler12_playing = function (channel, control, value, status, group) { + + { + var currentlyPlaying = engine.getValue("[Sampler12]","play"); + if (currentlyPlaying == 0){ + //engine.setValue("[Sampler12]","play",1); + midi.sendShortMsg(0x80,0x10,0x00); + } + else { + if (currentlyPlaying == 1){ + //engine.setValue("[Sampler12]","play",0); + midi.sendShortMsg(0x90,0x0f,0x00); + } + + } +} +engine.trigger("[Sampler12]","play"); +} + + + +RHMixxx.Channel1_paused = function (channel, control, value, status, group) { + + { + var currentlyPaused = engine.getValue("[Channel1]","play_indicator"); + if (currentlyPaused == 0){ + //engine.setValue("[Channel1]","play",1); + midi.sendShortMsg(0x80,0x08,0x00); + } + else { + if (currentlyPaused == 1){ + //engine.setValue("[Channel1]","play",0); + midi.sendShortMsg(0x90,0x08,0x00); + } + + } +} +engine.trigger("[Channel1]","play_indicator"); +} RHMixxx.OffAllLED = function () { midi.sendShortMsg(0x80,0x09,0x00); |