HELP: Analog Joystick + GlovePIE

HELP: Analog Joystick + GlovePIE

I’m trying to get GlovePIE working with some analog joysticks on a gamepad.
How can I get the value to return to 63 after I move the joystick?
i.e. How can I get the knob to return to the middle position after I have moved it?

//ANALOG STICKS
midi.Channel2.Control1=Joystick2.x/250

Some progress. If anybody cares. The knobs will now go to their max/min, but I can’t get them to return just quite to center. I think it’s because midi has 127 notes. Anyone know how to use a fraction in GlovePIE? If I add 63.5, the knobs all screwy. At 64 it’s off to the right just a little (0.09)

Just so you know, we do care, just sometimes people don’t have answers. If anything keep chronicling your progress and you might get to a point where someone does have an idea. And it’ll keep it toward the top for people who do know to help.

But we do care :wink:

Sorry if I can off jerkish. I figure there are other broke DJ’s like me looking to mod controllers on the cheap. So I will keep posting my stuff. I know I make mere toys to some of the work that goes on here.

Here is a GlovePIE script for a 12 button gamepad. I used a Logitech Duel Action. The analog joysticks are quite good for controlling more than one FX at a time. The rest work best as buttons. Map them to your program as you see fit. I plan on modding two gamepads to make one big custom FX controller.

I am pretty good at some GP scripts. I have made 2 controllers on the cheap, so I know what you are going through. I have never did anything with analog joysticks but I am almost sure all it is just 2 potentiometers. Put together. Are there 6 pins?

Let me look at your script and I’ll try and come up with something. :slight_smile:

The script was attached to my last post. I’m pretty sure that’s about as good as I can make it. I think I was having an error because I was writing the code in notepad then changing to CUE file. When I wrote the script in GlovePIE, it seemed to take. I think the knobs ending up off center is a Traktor thing, because when I used my BCD3000 I noticed the same behavior. Please take a look and give me any pointers. Yes, each joystick had two sets of 3 soldered connections.

Do you think I need to solder out these joysticks, OR can I just connect potentiometers to the proper spots, thereby closing that circuit? I would then hide the controller board with the joysticks still attached inside my enclosure. Then I wouldn’t have to use my poor desoldering skills, because these things look like a bitch to get out. There is also a switch underneath the joystick, but I’m sure I can close that with a new button easily. I like the joysticks, but think at the end of the day I prefer knobs.

I help with this… if GlovePie didnt crash so god damn much on me >_< - I gave up on GlovePie after becoming sick of the crashs

Joysticks are useful for different things than knobs are - take a look at moldovers setup for a really good way of using joysticks.

Its all about what you have it assigned to.

Anyway back to the original question.

I spose that you could use an if statement that checked to see if the joystick was centered and if it is send a 63 message instead of a 64.

I help with this… if GlovePie didnt crash so god damn much on me >_< - I gave up on GlovePie after becoming sick of the crashs

Joysticks are useful for different things than knobs are - take a look at moldovers setup for a really good way of using joysticks.

Its all about what you have it assigned to.

Anyway back to the original question.

I spose that you could use an if statement that checked to see if the joystick was centered and if it is send a 63 message instead of a 64.

Hm, what bento said might work for the centering issue. You may want to go on traktor and right click the knobs you are having issues with and select fine, I think that might help. One of my controllers can’t get exactly 50% either. Just 49 and 51 :smiley:.

On you script it seems like you need to use maprange. Let me pull up glovepie first before I give you a definite answer.

I tried using maprange before, but it never worked just right. Trial and error gave the results I am using.

Bento: I think Moldover uses like a flight joystick no? I’m just playing around with PS3 type controllers with two analog joysticks. It is interesting using them on FX, but I think at the end of the day I prefer the control knobs have.

Any ideas about adding in a potentiometer w/o soldering out the joystick? Or will this just chain them together?

have you tried setting the range as an odd number?
i.e. min = 0, max = 126 (127 units total)
this way you can use 64 as a middle point.

sup g

this is what im using on my x-fade

midi2.channel1.ByteControl20 = MapRange(Joystick1.x, -1,1, 0,1)

check these settings

-if your midi is not the default system device your going to have to try midi2.channel then midi3.channel unless you know your midi out device

-check calibration in windows for your device

-are you useing a midi cable out and back in to your pc or are you useing software loopback if software I use loobe1 free edition Download ipMIDI, LoopBeAudio, Loopbe1, LoopBe30

try and get your buttons going first if you have not also im not 100 percent sure that my code is the right way to do it but it works for me.

bump,

did you try that code cheft?

did not want this to go to page 2 incase he did not get the msg

hi guys, do any of you have cheft’s ZIP archive with the .PIE config for the joystick, i made a JOYSTICK2MIDI controller and i’m having issues in Windows 7 … wanted to confrunt the GP codes … thanks

here a pic of the “device” … everything’s fine but the codes …

[ATTACH]2790[/ATTACH]

this is what i comed up with in GP:

"
//BUTTONS
midi.Channel.C1=joystick1.Button1
midi.Channel.D1=joystick1.Button2
midi.Channel.E1=joystick1.Button3
midi.Channel.F1=joystick1.Button4
//TOP BUTTONS
midi.Channel.G1=joystick1.Button5
midi.Channel.A1=joystick1.Button6
midi.Channel.B1=joystick1.Button7
midi.Channel.C2=joystick1.Button8
//SELECT/START BUTTONS
midi.Channel.D2=joystick1.Button9
midi.Channel.E2=joystick1.Button10
//STICK BUTTONS
midi.Channel.F2=joystick1.Button11
midi.Channel.G2=joystick1.Button12
//POV
midi.Channel.A2=joystick1.Pov1Up
midi.Channel.B2=joystick1.Pov1Down
midi.Channel.C3=joystick1.Pov1Left
midi.Channel.D3=joystick1.Pov1Right
//ANALOG STICKS
midi.channel1.Slider1Fine=MapRange(Joystick1.x, -1,1, 0,1)
midi.channel1.Slider2Fine=MapRange(Joystick1.z, -1,1, 0,1)
midi.channel1.Slider3Fine=MapRange(Joystick1.y, -1,1, 0,1)
midi.channel1.Slider4Fine=MapRange(Joystick1.roll, -1,1, 0,1)
"

what this does in WIN7 x64 is … plays a piano sound when pressing diferent buttons on the “controller” … also .. trktor for example does not detect as midi input wher learn function is on … ableton also … in XP worked OK … any advices ? pointers ?

I couldn’t get Chefts zip archive to extract?

Anyway found this script by Cheft over at the glove pie forum.

//DUEL ACTION GAMEPAD TO MIDI
//WRITTEN FOR MIDI CHAN 1 ON JOYSTICK #1
midi.DefaultChannel=1
//BUTTONS
midi.C1=joystick1.Button1
midi.D1=joystick1.Button2
midi.E1=joystick1.Button3
midi.F1=joystick1.Button4
//TOP BUTTONS
midi.G1=joystick1.Button5
midi.A1=joystick1.Button6
midi.B1=joystick1.Button7
midi.C2=joystick1.Button8
//SELECT/START BUTTONS
midi.D2=joystick1.Button9
midi.E2=joystick1.Button10
//STICK BUTTONS
midi.F2=joystick1.Button11
midi.G2=joystick1.Button12
//POV
midi.A2=joystick1.Pov1Up
midi.B2=joystick1.Pov1Down
midi.C3=joystick1.Pov1Left
midi.D3=joystick1.Pov1Right
//midi.E3=joystick1.Pov1Center
//ANALOG STICKS
midi.Control1=(joystick1.x/261)+64
midi.Control2=(joystick1.y/261)+64
midi.Control3=(joystick1.z/261)+64
midi.Control4=(joystick1.roll/261)+64

Not sure if its what your after but it helped me figure things out

Thanks to Cheft

try changing the midi.channel1 to midi2.channel1, midi3.channel1, … ect

I have win7 64 also and it seems in the gui tab i select midi device but code is always just midi. If in the pull down tab your midi device is 3rd down then try midi3.channel1. Problem is I can not find how to set default midi device in windows.

search with Google for - “Vista Default Midi” - the option to chose default midi was removed when Vista appeared - someone created a lil’ app to let you chose default midi .

actually here it it - Vista MIDI Tool • benryves.com

and

http://www.softpedia.com/get/Multimedia/Audio/Other-AUDIO-Tools/Vista-MIDI-Picker.shtml

… thanks for tha tip - i’ll try that asap and come back with details.

… thanks fot tha tip, will try it ASAP

SAME thing extraclassic … :disappointed: … so this only means that the code does the same thing but writen in another way … and implicitly i think overal the code works … picks-up de signal sent by the joystick and converts it to MIDI signal … the weird thing is that in Windows XP when pressing the joystick/“controller” - there was NO sound in a desktop environment and while in Traktor OR Ableton midi “lights” were signaling MIDI input … also when assigning a button to a MIDI signal everything went perfect …

NOW in Windows 7 … i hear the classic piano sound - on notes even - everyjoystick/“controller” button is a piano note :slight_smile: … the thing is thow that no MIDI software can pick-up MIDI signal … nothing … absolutelly nothing … piano sound everytime - BUT NO MIDI signal in midi apps.

hope i gave a better description this time and hopefully at least one person encountered the same issue with Windows 7 → and has a solution .

thanks.