Open kokoi1 opened 5 years ago
This is happening to me too. Do you know how to unpress buttons? I'll dig into the code but it might take awhile to figure out!
Same issue on the Rock Band Keyboard. (the keyboard controller for Rock Band 3, but connected via midi)
Having the same issue with AKM320 keyboard. Mod wheels and Slider working fine, but keypresses stay on when pressed.
Same with my Xtouch compact
I just submitted a pull request that fixes this issue
I added a modified version in the issue section with a complete hacked script to adress this problem as a zip file This should work Lareooreal
The problem is here:
elif key[0] == 128:
# A button off input
vjoy.SetBtn(reading, opt[0], int(opt[1]))
which sends the reading of the physical button pressed (eg. velocity on piano) for vJoy and vJoy uses this as the state of the virtual button. But my piano, and I'd guess many other MIDI devices as well, send a default reading of 64 (pushed with half pressure out of the maximum) for every button release message. If you change the code to send a 0 every time it receives a status 128 (note off on channel 1) it's fixed. You need to specify every note off in the .conf-file though:
midi2vjoy.py:
elif key[0] == 128:
# A button off input
vjoy.SetBtn(0, opt[0], int(opt[1]))
example.conf:
# Note on
144 24 1 1
# Note off
128 24 1 1
Thanks for the author of the program. I'm modifying it to use piano chords as gamepad buttons 🌚
Also need to add 129 and 145 for i.e. Novation Circuit which sends these IDs for the second instrument
elif key[0] == 128 or key[0] == 129:
# ...
elif key[0] == 144 or key[0] == 145:
First of all thank you very much for this amazing tool.
I mapped my LPD8, and while the knobs are working great as all the axis, the buttons are working ones but then stay stuck as pressed.
The tester give me these values when a button is being pressed: [[[144, 40, 11, 0], 2588]] [[[128, 40, 127, 0], 2813]]
I tried to map button 1 as 144 40, but it seems that then the joystick doesn't know that the button is not being pressed anymore (I guess event 128 40).
I hope that I'm just doing something wrong here.
Daniel