jackun / USBqemu-wheel

PCSX2 usb plugin for wheels and increasingly more stuff
The Unlicense
121 stars 21 forks source link

Add MIDI device emulation (Roland PC-300 MIDI Keyboard, Yamaha UX16 USB-MIDI Interface) #62

Closed 987123879113 closed 3 years ago

987123879113 commented 3 years ago

This is an attempt at emulating the MIDI devices used by the games in the list below. With the recent inclusion of the actual Keyboardmania USB keyboard support, and the fact that Drummania is already playable with a gamepad, I feel less resistance to offering up this PR because it has some restrictions.

This code expects MIDI devices as input devices instead of normal gamepads. All supported games are already playable through gamepads as of #60, and introducing outside converters (MIDI -> keyboard press, etc) has some overhead which isn't desirable for music games. As such, this PR is Windows only due to its use of Win32 MIDI APIs. I have no experience with MIDI on nix and don't have a suitable environment to develop a replacement MIDI input system for nix, so there is a noop stub in place for non-Win32.

Some expected issues:

Demo: https://streamable.com/tl5l4s

Tested/Supported games

Roland PC-300 MIDI Keyboard

Yamaha UX16 USB-MIDI Interface

NOTE: MIDI drum kits typically use MIDI channel 10 and GFDM expects events on MIDI channel 10. The input MIDI device must be sending events on channel 10 for it to be recognized in-game.