I'm attempting to map a MIDI controller to various Vjoy inputs (analogue & digital) but hitting a brick wall. I have read through these:viewtopic.php?f=139&t=20537viewtopic.php?f=139&t=21436https://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:
vJoy.slider = filters.mapRange(midi.data.buffer, 127, 0, 17873, -17873)
midi.update += update
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:
vJoy.slider = filters.mapRange(midi.data.buffer == 07, 127, 0, 17873, -17873)
or with additional parentheses:
vJoy.slider = filters.mapRange((midi.data.buffer == 07), 127, 0, 17873, -17873)
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?