Glovepie Gamepad Script By Extra Classic

Glovepie Gamepad Script By Extra Classic

Here is a script for 2 Gamepads that I’ve just made for Glovepie. This script will translate your button, thumbstick and POV into midi.

I’m hoping this might help some of you get your gamepads communicating with your DJ software.

Please note that I use Windows XP although I have been told Glovepie works fine with Windows 7 too. You also need to have Midiyoke or the equivilant installed first.

This script will give you per Gamepad.

Buttons = 12
POV = Left, Right, Up, Down
Analogs = 4 (x, y, z, z roll)

http://www.mediafire.com/?dyap2duo5025mo6

Remember children to say thankyou if you find this useful :slight_smile:

nice one mate :slight_smile:

here’s another one - just one joypad but it has different ‘scenes’ so it might help other people with glovepie programming:

[quote]I wrote a govePIE-script which converts the data of a USB-Joypad into MIDIdata. So you can fire patterns in your sequencer-software by pressing the buttons and squirl filters and effekts with the 2 analog sticks.

All you need is glovepie (a freeware programmable input emulator), direct x8 (or higher) and a programm to route the midisignal inside your computer (e.g. midiox). Then run the script….

Here is a short describtion:

  • ALL DATA send on midichannel 3

  • 40 BUTTONS (4 Scenes a 10 Buttons)

  • buttons send a single midinote when pressed* -ideal for fire patterns in Ableton LIVE

  • 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 (independent from the button scene selection):

  • button 9 (left stick) or 10 (right stick) pressed*:

  • x-axis (left-right) 0-127 (CC 99 / CC 20)

  • y-axis (bottom-top) 0-127 (CC 100 / CC 21)

  • if you release the button,the value holds the last position until pressed again
  • normal (no button pressed):
  • x-axis (left-right) 0-127 (CC 96 / CC 22)
  • y-axis (middle-top) 0-127 * (CC 97 / CC 23)
  • y-axis (middle-bottom) 0-127 * ** (CC 98 / CC 24)
  • (done that way to get a defined zero at middle position)
    **(this value tends to stuck… move stick slowely or even dont use it! damn bug)

This script might be quite complex, to get a huge output from the few buttons and analog sticks, but it is really easy to handle and ergonomic…. i played it the whole weekend and had so much fun, i even couldn´t stop it
And - if you want to make some changes - the script is easily to edit…. [/quote]

These scripts which use a gamepad button as a ‘scene’ switch - would they work across multiple gamepads?

For example:
if (Joystick1.button5) = true then begin
midi.channel3.c5 = pressed (Joystick1.button1)
midi.channel3.d5 = pressed (Joystick2.button1)

It seems like it would but my gamepads are in 50 pieces packed away in a box right now.

yes, you can select different joysticks via Joystick1, Joystick2…

A newbie here, I want to use glove pie and loopmidi for my gamepad controller but I don’t know how this two will help me, I alreasy installed loopmidi and use your glovepie scripts but I have a bad time in mapping it in traktor. thank you for your reply in advance :slight_smile:

before mapping in traktor u need to check/confirm that the script is converting the right button presses etc into midi. the variables tab will show u any variables that change value, tho dont remember if the script actually uses any.

if the midi activity light in trakor lights up when ever u press any button u might be good to go anyway though.

something like midiox (for windows) is handy to check that midi data is being sent for each button press. make sure you’re not trying to run traktor attached to the loopmidi port at the same time tho.

Thanks zestoi, Actually this the are things I done for the last couple of hours, I installed midi yoke in windows 7, then I downloaded glovepie and Extra Classic Script, when I ran the script I hear some tone when I press each button, I realize it was a good indication so I went mapping it with traktor pro, but at this point I dont know how to do it. :confused: and maybe I am missing something, I also tried to use rejoice but nothing happens, hope you will help me. thanks again

not sure what/where the sounds are that you’re hearing - but in traktor make sure you create a new generic midi device in the controller manager and then select the loopMIDI input port for it.

from there you just add>in whatever u want to try - going for something easy like ‘play’ first or something i guess - then click ‘learn’ and press the button u want. also select the deck u want it to control, or u can make the whole config/tsi deck focussed by selecting a global default - i’ve never done that tho.

i think the sounds come from some sort of internal MIDI converter from Windows, which turns the notes from your script into sounds (as MIDI notes were supposed to).

add the following line:

midi.DeviceOut = 2

the default setting is 1, which is the windows midi device mentioned above.

depending on you configuration you might have to choose device 3, just see what works for you.

hope this helps!

Thanks zestoi and derschaich,:slight_smile: I have managed to use midi yoke and rejoice and mapped some buttons in traktor pro using my gamepad, but i never tried to control the it with my analogs, I would like to use it for volume and effects, do you think it would be possible using rejoice?

i’ve never used rejoice so not sure what it can and can’t do - you can definately use the analogs from glovepie tho.

i have a question, in what way you can determine what midi yoke port are you using when you are using glovepie? and how can I map this to traktor. :confused:

the trick i always use is to add this to your config:

debug = midi.OutDevName

then the name of the output device will be shown in a small debug text box near the top of glovepie. i always have it in my configs as i often change midi devices so always need to confirm that the right one is selected.

alternatively you can use this bit of code i wrote that then lets you select the port by name and not id. personally i don’t use it as i think it’s overkill and only takes a couple of tweaks and restarts to get the right device selected by id:

var.DevName = "test"

if (var.Init == 0) then
for var.Count = 0 to 20 do
midi.DeviceOut = var.Count
if (midi.OutDevName ~= var.DevName) then
debug = "Selected: " + midi.OutDevName + " at id=" + floor(var.Count)
var.Count = 21 // end the loop
end if
end for
var.init = 1
endif

that code only gets run the very first time (due to the var.Init stuff) and then displays your selected device in the same debug area i mentioned before.

I copied the script but I cant find the small text box that you said, i just paste the scripts at the last line, maybe I am not doing right.:disappointed:

debug textbox is in the top right corner of glovePIE, ,make sure you start the script before searching the debug-box

analogues are easy to incorporate into the scrips, as the analogues of your gamepad register as the x,y,z axis of a joystick as in the end of my script:

midi.DeviceOut = 2

debug = Joystick.NumberOfPOVs

//buttons:
midi.channel3.c4 = Joystick1.button1
midi.channel3.csharp4 = Joystick1.pov1left
midi.channel3.d4 = Joystick1.pov1down
midi.channel3.dsharp4 = Joystick1.button4
midi.channel3.gsharp3 = Joystick1.button5
midi.channel3.a3 = Joystick1.button6
midi.channel3.asharp3 = Joystick1.button7
midi.channel3.b3 = Joystick1.button8
midi.channel3.e3 = Joystick1.button9
midi.channel3.f3 = Joystick1.button10
midi.channel3.fsharp3 = Joystick1.button11
midi.channel3.g3 = Joystick1.button12
midi.channel3.c3 = Joystick1.button2
midi.channel3.csharp3 = Joystick1.pov1up
midi.channel3.d3 = Joystick1.pov1right
midi.channel3.dsharp3 = Joystick1.button3

//analogs:
//midi.channel3.cc66 = MapRange(Joystick1.x, -1,1, 0,1)
//midi.channel3.cc67 = MapRange(Joystick1.y, -1,1, 0,1)
//midi.channel3.cc68 = MapRange(Joystick1.z, -1,1, 0,1)
//midi.channel3.cc69 = MapRange(Joystick1.roll, -1,1, 0,1)

thanks for this, I got it working thanks to you guys, now I am thinking about the mapping, can you suggest some reminders in mapping your gamepad midi controller because I cant decide the functions of each button because I want it to be useful as I expected..thank you in advance ;D

keep in mind, that the four buttons on your d-pad (the four directions thingy on the left) only state one direction at a time!

if i were going to use the midi fighter mapping, using glovepie, I will just edit the script and make it the same with the midi fighter?

yep - but which notes depend on whether u need normal mode (deckalized) or 4banks (instant grat)

i’m sure there’s a glovepie script here somewhere for both modes, that uses the top row as bank change buttons. here’s all the note info anyway:

normal mode

C3    C#3   D3    D#3
G#2   A2    A#2   B2
E2    F2    F#2   G2
C2    C#2   D2    D#2

4 bank mode

C-1   C#-1  D-1   D#-1
G#2   A2    A#2   B2
E2    F2    F#2   G2
C2    C#2   D2    D#2

(replace octave 2 with 3,4,5 for other banks in rows 2,3,4)

in fact it was also coded by derschaich :wink:

glovepie 4banks script: Instant Gratification - mapping to my controller - Page 3