Jump to content

Using A Midi Foot Pedal


8 replies to this topic

#1 Stijnovic

    Member

  • PipPipPip
  • Philanthropist
  • Philanthropist
  • 63 posts
  • LocationThe Netherlands

Posted 13 September 2015 - 01:59 PM

I recently looked at my Behringer FCB1010 Midi Foot Controller. It struck me that it would make an excellent input device for Mechwarrior! It has 2 pedals (tank drive!) and 10 assignable buttons.

Posted Image

I used a USB-MIDI adapter to connect it with my pc. Then GlovePIE to convert the Midi signal to a virtual joystick made with PPJoy. Unfortunately, MWO did not detect this virtual joystick so I had to also install VJoy, it used some magic to make it work in MWO, not sure how this worked.

Here are 2 guides I used: GlovePIE + PPJoy, VJoy remapper

Also 1 question:
Can you use 1 pedal for the full throttle range: -100% to +100%, so including reverse, with zero being throttle somewhere in the middle?

#2 zaku potion

    Member

  • PipPipPip
  • Elite Founder
  • Elite Founder
  • 53 posts
  • LocationSOUTH TX

Posted 13 September 2015 - 11:12 PM

Yes that will work the same way a joystick using an axis for throttle will. Bind the axis to where it says Analog Throttle at the top.



Posted Image

#3 Stijnovic

    Member

  • PipPipPip
  • Philanthropist
  • Philanthropist
  • 63 posts
  • LocationThe Netherlands

Posted 15 September 2015 - 06:48 AM

Ah yes makes sense.

Does anyone have experience in using two pedals in a "tank-drive" configuration? Would be nice if I could do both throttle and turning with the 2 pedals...

#4 Footupyzz

    Member

  • PipPipPipPipPip
  • Legendary Founder
  • Legendary Founder
  • 111 posts
  • Locationplanet earth

Posted 15 September 2015 - 06:58 AM

@Stijnovic hoe is ie?^^ ook nog steeds diehard player zie ik:D
how is the playing experience with it ?
improved or same?

#5 Shin Ken

    Member

  • PipPipPip
  • Elite Founder
  • Elite Founder
  • 73 posts
  • LocationLower Saxony, Germany

Posted 09 October 2015 - 06:23 PM

View PostStijnovic, on 13 September 2015 - 01:59 PM, said:

I recently looked at my Behringer FCB1010 Midi Foot Controller. It struck me that it would make an excellent input device for Mechwarrior! It has 2 pedals (tank drive!) and 10 assignable buttons.

Posted Image

I used a USB-MIDI adapter to connect it with my pc. Then GlovePIE to convert the Midi signal to a virtual joystick made with PPJoy. Unfortunately, MWO did not detect this virtual joystick so I had to also install VJoy, it used some magic to make it work in MWO, not sure how this worked.

Here are 2 guides I used: GlovePIE + PPJoy, VJoy remapper

Also 1 question:
Can you use 1 pedal for the full throttle range: -100% to +100%, so including reverse, with zero being throttle somewhere in the middle?


I'm using VJoy with a similar MIDI device. How is MWO recognizing your controller? I had no luck so far :(

EDIT:
I got it working as well :D. It's a MIDI slider as a throttle - you can read about it here if you want:
http://mwomercs.com/...ost__p__4754674

Edited by Shin Ken, 09 October 2015 - 07:21 PM.


#6 Shin Ken

    Member

  • PipPipPip
  • Elite Founder
  • Elite Founder
  • 73 posts
  • LocationLower Saxony, Germany

Posted 10 October 2015 - 01:04 AM

As my MIDI stuff now works as well you may also want to cut the middle man and connect your MIDI device directly to VJoy using a FreePIE Python script. It's not much more complicated than a GlovePIE script (in some regards it's easier) and assuming you have Windows 7 or newer, you don't have to use Test Mode for PPJoy this way which is always a huge safety and stability concern. Probably saves some milliseconds delay as well.

I've done some FreePIE MIDI scripting myself and can help you. Basically, FreePIE does not have every MIDI command translated like GlovePIE but works with more general use buffers which you have to differentiate using if-statements in the python language. It's a bit more complex but also a lot more universally applicable, logical and straightforward. I'll explain it in more detail if you want to.

Edited by Shin Ken, 10 October 2015 - 01:30 AM.


#7 Stijnovic

    Member

  • PipPipPip
  • Philanthropist
  • Philanthropist
  • 63 posts
  • LocationThe Netherlands

Posted 05 December 2015 - 08:20 AM

View PostFootupyzz, on 15 September 2015 - 06:58 AM, said:

@Stijnovic hoe is ie?^^ ook nog steeds diehard player zie ik:D
how is the playing experience with it ?
improved or same?

Hey! Sorry for late reply. I have been using the twin pedal setup for quite some time now and I really like it! It took me a long time to get used to it though, frantically pressing [w] with nothing happening... Posted Image
I use the right pedal for 0-100% throttle and the left pedal for 0-100% throttle backwards. Whichever is pressed further "wins". This makes peeking super easy and fast. Also it gives me a lot of extra keys that I can use. But yeah, you need to give it some time. Using my feet was really not intuitive for me at first (even though I can drive a car and play both piano and drums).

View PostShin Ken, on 10 October 2015 - 01:04 AM, said:

As my MIDI stuff now works as well you may also want to cut the middle man and connect your MIDI device directly to VJoy using a FreePIE Python script. It's not much more complicated than a GlovePIE script (in some regards it's easier) and assuming you have Windows 7 or newer, you don't have to use Test Mode for PPJoy this way which is always a huge safety and stability concern. Probably saves some milliseconds delay as well.

I've done some FreePIE MIDI scripting myself and can help you. Basically, FreePIE does not have every MIDI command translated like GlovePIE but works with more general use buffers which you have to differentiate using if-statements in the python language. It's a bit more complex but also a lot more universally applicable, logical and straightforward. I'll explain it in more detail if you want to.

This is interesting! I'm now in the process of reinstalling my pc and was checking this topic to see how I did it again. But now I see you have an improvement! Posted Image I do prefer the non-test mode for Windows 7. I'll see if I can manage by myself to fix it your way.

I found your script:
def update():
vJoy[0].rz = filters.mapRange(midi[0].data.buffer[1], 0, 127, -17873, 17873)
 
if starting:
midi[0].update += update

My device sends controll change messages on #7 and #14 but I don't know how to acces those from the python script. How do you set the device and channel? This was my old GlovePIE script:
midi.DeviceIn = 2
midi.DefaultChannel = 1
 
if midi.cc7 > midi.cc14 then
   PPJoy1.Analog0 = midi.cc7
else
   PPJoy1.Analog0 = -midi.cc14
end

Also, when I use Midi-OX, to check what my device is sending, I get something like this:
Timestamp In Port Status Data1 Data2 Chan Note Event
01A71804  2  2	B0	 0E	02	1	---  Control Change (pedal 1)
01AACAB1  2  2	B0	 07	10	1	---  Volume (pedal 2)

Okay, it seems to be working now with the following script:
def update():
    global pedalleft
    global pedalright
    
    pedalvalue = filters.mapRange(midi[1].data.buffer[1], 0, 127, 0, 17873)
    pedalchannel = midi[1].data.buffer[0]
    
    if pedalchannel==14:
        pedalright = pedalvalue
    else:
        pedalleft = pedalvalue
    
    if pedalleft > pedalright:
        vJoy[0].x = -pedalleft
    else:
        vJoy[0].x = pedalright
    
if starting:
    pedalleft = 0
    pedalright = 0
    midi[1].update += update

Edited by Stijnovic, 05 December 2015 - 06:10 PM.


#8 Shin Ken

    Member

  • PipPipPip
  • Elite Founder
  • Elite Founder
  • 73 posts
  • LocationLower Saxony, Germany

Posted 06 December 2015 - 02:01 AM

Good to hear it worked out! That's a good script to map two input ranges on one virtual Joystick axis!

I think scripting with FreePIE is actually quite fun if one gets the hang of it Posted Image. By now, when I don't like any control option in a game which can't be changed, I always look forward to just make a script that let's me do it anyway Posted Image

#9 Stijnovic

    Member

  • PipPipPip
  • Philanthropist
  • Philanthropist
  • 63 posts
  • LocationThe Netherlands

Posted 07 December 2015 - 01:51 AM

Haha yes it is very satisfying to write your own scripts! Especially if it doesn't work at first, but then you manage to fix it. Posted Image

Btw, if you like scripts, games and puzzles, check out TIS-100!





3 user(s) are reading this topic

0 members, 3 guests, 0 anonymous users