//JOYPAD to MIDI //GlovePIEscript by www.tonvibration.de //vers0.1 /* getting started: - install glovepie: http://carl.kenner.googlepages.com/glovepie_download - install a programm to route the midisignal inside your computer, e.g.: http://www.midiox.com/ - furthermore you need Direct X 8 (or higher version) -presumably already installed on your computer - set your default midi to "MIDI Yoke NT:1"(GlovePIE ->CP-Settings ->Midi ->...) - aktivate NT1 at the midi-preferences of your sequenzer - run this script in glovePIE */ /* hardware: I use a "thrustmaster dual analog3" USB-joypad But the programm should work with other joypads too. Check out the technical capabilities of your joypad at: GlovePIE -> CP-Settings -> Joystick -> Proberties */ /* main concept - all data send on midichannel 3 - 40 BUTTONS (4 Scenes a 10 Buttons) - buttons send a single midinote when pressed - scene selection: press and hold button 5 / 6 / 5+6 / none (left front) - buttons: 1-4 (right top), 7-8 (right front), cooliehat (left top) *(read scene comments for details) - ANALOG STICKS got 2 modes: - button 9 (left stick) or 10 (right stick) pressed: - x-axis (left-right) 0-127 - y-axis (bottom-top) 0-127 if you release the button, the value holds the last position until pressed again - normal (no button pressed): - x-axis (left-right) 0-127 - y-axis (middle-top) 0-127* - y-axis (middle-bottom) 0-127* ** * (to get a defined zero at middle position) **(this value tends to stuck move stick slowely or even dont use it! damn bug) */ // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // -------------- BUTTONS ----------------------- // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // if BUTTON 5 is pressed ----------------------------- /* This scene is intended for trigger drums (c5-c6) */ if (Joystick1.button5) = true then begin midi.channel3.c5 = pressed (Joystick1.button1) midi.channel3.d5 = pressed (Joystick1.button3) midi.channel3.e5 = pressed (Joystick1.button2) midi.channel3.f5 = pressed (Joystick1.button4) midi.channel3.g5 = pressed (Joystick1.button7) midi.channel3.a5 = pressed (Joystick1.button8) //cooliehat midi.channel3.b5 = pressed (Joystick1.pov1down) midi.channel3.c6 = pressed(Joystick1.pov1right) midi.channel3.fsharp5 = pressed(Joystick1.pov1left) midi.channel3.gsharp5 = pressed(Joystick1.pov1up) // if BUTTON 6 is pressed ------------------------------ /* this scene is intended for scene selection in LIVE - use button 1-4 for scene up/down, fire scene, stop clips. - button 7+8 send the same signal again when released, use them to solo or mute tracks if hold down*/ end elseif (Joystick1.button6) = true then begin midi.channel3.c1 = pressed (Joystick1.button1) midi.channel3.d1 = pressed (Joystick1.button3) midi.channel3.f1 = pressed (Joystick1.button2) midi.channel3.g1 = pressed (Joystick1.button4) midi.channel3.a1 = pressed (Joystick1.button7) midi.channel3.a1 = released (Joystick1.button7) midi.channel3.b1 = pressed (Joystick1.button8) midi.channel3.b1 = released (Joystick1.button8) //cooliehat midi.channel3.csharp1 = pressed (Joystick1.pov1down) midi.channel3.dsharp1 = pressed(Joystick1.pov1right) midi.channel3.fsharp1 = pressed(Joystick1.pov1left) midi.channel3.gsharp1 = pressed(Joystick1.pov1up) // if button 5+6 is pressed ---------------------------- end elseif (Joystick1.button6)and(Joystick1.button5) = true then begin midi.channel3.c2 = pressed (Joystick1.button1) midi.channel3.d2 = pressed (Joystick1.button3) midi.channel3.f2 = pressed (Joystick1.button2) midi.channel3.g2 = pressed (Joystick1.button4) midi.channel3.a2 = pressed (Joystick1.button7) midi.channel3.b2 = pressed (Joystick1.button8) //cooliehat midi.channel3.csharp2 = pressed (Joystick1.pov1down) midi.channel3.dsharp2 = pressed(Joystick1.pov1right) midi.channel3.fsharp2 = pressed(Joystick1.pov1left) midi.channel3.gsharp2 = pressed(Joystick1.pov1up) // NO button pressed ----------------------------- end else begin midi.channel3.c0 = pressed (Joystick1.button1) midi.channel3.d0 = pressed (Joystick1.button3) midi.channel3.f0 = pressed (Joystick1.button2) midi.channel3.g0 = pressed (Joystick1.button4) midi.channel3.a0 = pressed (Joystick1.button7) midi.channel3.b0 = pressed (Joystick1.button8) //cooliehat midi.channel3.csharp0 = pressed(Joystick1.pov1down) midi.channel3.dsharp0 = pressed(Joystick1.pov1right) midi.channel3.fsharp0 = pressed(Joystick1.pov1left) midi.channel3.gsharp0 = pressed(Joystick1.pov1up) endif // ---------------------------------------------- // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx // --------------- STICKS ----------------------- // xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx //------------- LEFT STICK ----------------------- midi.channel3.ByteControl96 = var.LSx midi.channel3.ByteControl97 = var.LSyup midi.channel3.ByteControl98 = var.LSydown midi.channel3.ByteControl99 = var.LSxB midi.channel3.ByteControl100 = var.LSyB if (Joystick1.button9) = true var.LSxB = MapRange(Joystick1.x, -1,1, 0,127)/127 var.LSyB = MapRange(Joystick1.y, -1,1, 127,0)/127 end else var.LSx = MapRange(Joystick1.x, -1,1, 0,127)/127 if (Joystick1.y < 0.0)= true var.LSyup = MapRange (Joystick1.y, -1, 0, 127,0)/127 end elseif (Joystick1.y > 0.0)= true var.LSydown = MapRange(Joystick1.y, 0,1, 0,127)/127 endif endif //-------------- RIGHT STICK --------------------- midi.channel3.ByteControl20 = var.RSxB midi.channel3.ByteControl21 = var.RSyB midi.channel3.ByteControl22 = var.RSx midi.channel3.ByteControl23 = var.RSyup midi.channel3.ByteControl24 = var.RSydown if (Joystick1.button10) = true var.RSxB = MapRange(Joystick1.roll, -1,1, 127,0)/127 var.RSyB = MapRange(Joystick1.slider, -1,1, 0,127)/127 end else var.RSx = MapRange(Joystick1.roll, -1,1, 0,127)/127 if (Joystick1.slider < 0.0)= true var.RSyup = MapRange (Joystick1.slider, -1, 0, 127,0)/127 end elseif (Joystick1.slider > 0.0)= true var.RSydown = MapRange(Joystick1.slider, 0,1, 0,127)/127 endif endif