FreePIE MIDI input, some questions
Posted: Sat Jan 07, 2017 11:55 pm
I'm attempting to map a MIDI controller to various Vjoy inputs (analogue & digital) but hitting a brick wall. I have read through these:
http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=20537
http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=21436
https://github.com/AndersMalmgren/FreePIE/issues/81
From the above, I am using a script that allows me to use a slider on the MIDI controller as a throttle in flight sims:
This works nicely on its own. However, any other inputs on the MIDI controller also affect the output (ie. hitting a MIDI key or tweaking a knob also makes my throttle control jump around). I guess this is because the above code is looking at the entire data buffer of the device, not a single channel.
The slider is a volume control, which is MIDI CC 07. So I am trying to get the script to listen to that only, for example:
or with additional parentheses:
But with any change I make, the output ceases. If I only wanted to use the slider I wouldn't mind, but I would also like to map some button inputs. Can anyone help with the correct syntax?
http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=20537
http://www.mtbs3d.com/phpBB/viewtopic.php?f=139&t=21436
https://github.com/AndersMalmgren/FreePIE/issues/81
From the above, I am using a script that allows me to use a slider on the MIDI controller as a throttle in flight sims:
Code: Select all
def update():
vJoy[0].slider = filters.mapRange(midi[0].data.buffer[1], 127, 0, 17873, -17873)
if starting:
midi[0].update += update
The slider is a volume control, which is MIDI CC 07. So I am trying to get the script to listen to that only, for example:
Code: Select all
vJoy[0].slider = filters.mapRange(midi[0].data.buffer[1] == 07, 127, 0, 17873, -17873)
Code: Select all
vJoy[0].slider = filters.mapRange((midi[0].data.buffer[1] == 07), 127, 0, 17873, -17873)