https://github.com/muhac/midi-controller-joysticks
Use MIDI controllers as joysticks. Let's play Microsoft Flight Simulator!
https://github.com/muhac/midi-controller-joysticks
desktop joystick midi simulation windows
Last synced: 4 months ago
JSON representation
Use MIDI controllers as joysticks. Let's play Microsoft Flight Simulator!
- Host: GitHub
- URL: https://github.com/muhac/midi-controller-joysticks
- Owner: muhac
- License: mpl-2.0
- Created: 2024-04-15T20:29:02.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-06-15T06:29:50.000Z (7 months ago)
- Last Synced: 2025-09-07T01:40:07.048Z (4 months ago)
- Topics: desktop, joystick, midi, simulation, windows
- Language: C#
- Homepage:
- Size: 740 KB
- Stars: 3
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# MIDI Controllers to Joysticks
Simulate joystick inputs using MIDI controllers!
## Installation
1. Install vJoy [v2.2.2](https://github.com/BrunnerInnovation/vJoy/releases/tag/v2.2.2.0).
2. Download the [latest release](https://github.com/muhac/midi-controller-joysticks/releases/latest) of this project.
3. Extract the contents of the downloaded archive.
4. Run `MIDIvJoy.exe` to start the program.
To use a different version of vJoy (e.g., [v2.1.9](https://sourceforge.net/projects/vjoystick/files/Beta%202.x/2.1.9.1-160719/) or [v2.2.1](https://github.com/njz3/vJoy/releases/tag/v2.2.1.1)), you need to also download the `SDK.zip` file. Copy and replace the corresponding `vJoyInterface.dll` and `vJoyInterfaceWrap.dll` from the sdk folder (`SDK\c#\x86` in the zip file) to the extracted folder (where `MIDIvJoy.exe` is located).
## Usage
This program listens for MIDI controller inputs and maps them to vJoy joystick inputs. It will automatically detect any connected MIDI controllers and enabled vJoy devices.
Just move the fader/knob/button on your MIDI controller and the program will catch and list them in the `Unassigned` list. You can then map the detected MIDI event to a vJoy action by clicking on it and editing the properties in the popup window.

There are two basic types of joystick actions: `Axis` and `Button`.
For the axis, you can change the range of the MIDI event by setting the minimum and maximum values. The action will be activated when the MIDI event value is within the *trigger range*, while the position of the joystick axis will be calculated based on the *full range*.
That is,
$$\textrm{axis percentage} = \begin{cases} {\rm max}\ \left(0,\ \ {\rm min}\ \left(1,\ \ \dfrac{{\rm value} - {\rm full}\_{\rm min}}{{\rm full}\_{\rm max} - {\rm full}\_{\rm min}} \right)\right) & \textrm{if }\ {\rm trigger}\_{\rm min} \leq {\rm value} \leq {\rm trigger}\_{\rm max} \\\\ {\rm unchanged} & \textrm{otherwise} \end{cases}$$
It is possible to assign multiple joystick actions to a single MIDI event with different trigger ranges (but do not overlap).
You can tweak these ranges to get the desired sensitivity and dead zone.

For buttons, you can set the button number and whether the button is pressed or released. If you use the `Auto` option, the program will automatically set the value - released if the value is equal or smaller than the minimum value in *full range*, pressed if greater. That is,
$$\textrm{button value} = \begin{cases} {\rm unchanged} & \textrm{if }\ {\rm value} < {\rm trigger}\_{\rm min} \ \textrm{ or }\ {\rm value} > {\rm trigger}\_{\rm max} \\\\ 0;\ \textit{(off)} & \textrm{if }\ {\rm value} \leq {\rm full}\_{\rm min} \\\\ 1;\ \textit{(on)} & \textrm{if }\ {\rm value} > {\rm full}\_{\rm min} \end{cases}$$

However, for knobs, you need to set two actions separately for clockwise and counterclockwise. This kind of action can only be simulated as continuous button presses now (50 ms on and then 50 ms off). It is possible but does not work well in MSFS to implement knob actions as axis increments/decrements. PRs are welcome if you have a better idea!

After you have mapped all the MIDI events to vJoy actions, you should engage the vJoy by clicking the respective joystick button at the bottom of the window. The program will start sending the corresponding joystick actions to the vJoy device. You can disable the joystick by clicking the button again.
**Your configuration will be saved and loaded automatically, but you need to engage the joystick manually every time you start the program.**
There is a simple vJoy monitor that shows the current state of the vJoy devices. You can use this monitor to check if the joystick inputs are working as expected.

## Related Projects
- [Virtual Joystick](https://github.com/njz3/vJoy)