MIDIio SimHub plugin: now with Joystick support
Note: requires a recent (9.X) version of SimHub
For one MIDI input and one MIDI destination device, this SimHub plugin routes configured Button, Slider and Knob
Control Change (CC) messages,
for e.g. on-the-fly tweaking suitably customized ShakeIt Bass Shaker effects.
Similarly, SimHub properties can be configured for buttons and axes from one Joystick input device.
Unconfigured CC messages received either dynamically generate new properties or are forwarded to a target Device.
MIDI C# code evolved from SimHub's User.PluginSdkDemo
,
using Melanchall.DryWetMidi
's DLL (already in SimHub).
MIDIio also generates DirectInput Button and Axis joystick inputs for games,
reusing C# sample code from vJoy.
MIDI CCs and vJoy sends are rescaled values from configured SimHub properties,
e.g. ShakeIt Bass Shaker effects.
Motivation and development How-To's
MIDIio Source code files, configuration descriptions
principles of operation
June 2023 revisions provoked by SimHub updates
- This plugin is compatible with SimHub 8.4.3's
Controllers input
andControl mapper
plugins- This allows e.g. forwarding real
Controllers input
properties to MIDIout or vJoy;
Do NOT configure vJoy properties fromControllers input
; that would provoke feedback loops!
- This allows e.g. forwarding real
- This plugin is incompatible with SimHub's Midi Controllers Input plugin
- Enabling both causes SimHub to crash!!!
- Like SimHub's
Midi Controllers Input
plugin,
MIDIio can automatically set CCn properties for received CCn messages not already configured,
but (unlike SimHub's) from only the single configured MIDI device.
This is expected to be used mostly for identifying CC numbers to configure. - SimHub bundles vJoy DLL v2.1.8, while vJoy is v2.1.9.1 is available.
- This plugin is configured using SimHub properties; it has NO interactive interface window.
-
configure this plugin by editing
NCalcScripts\MIDIio.ini
, which goes inSimHub\NCalcScripts\
folder -
check System log for MIDI and/or vJoy related messages:
-
this is not (nor can it become) a "plug and play" solution;
configuring MIDI on Windows is very much DIY.
-
- vJoy button numbering
- Windows'
joy.cpl
and vJoy API consider the first button to be 1,
but SimHub reports that first button asJoystickPlugin.vJoy_Device_B00
:
- For consistency within SimHub, it is configured as
MIDIvJoyB00
in NCalcScripts/MIDIio.ini.
- Windows'
For testing, this ShakeIt profile has a custom effect with ShakeITBSV3Plugin properties from MIDI sliders.
18 Jun 2023
- JoystickPlugin properties are unavailable before MIDIio plugin Init() completes:
[2023-06-18 09:52:41,546] INFO - MIDIio.DoSend(vJoyaxis): null JoystickPlugin.SideWinder_Precision_2_Joystick_X for SourceName[1][0]^M
[2023-06-18 09:52:41,546] INFO - MIDIio.DoSend(vJoyaxis): null JoystickPlugin.SideWinder_Precision_2_Joystick_Y for SourceName[1][1]^M
[2023-06-18 09:52:41,546] INFO - MIDIio.DoSend(vJoyaxis): null JoystickPlugin.SideWinder_Precision_2_Joystick_Slider0 for SourceName[1][2]^M
[2023-06-18 09:52:41,551] INFO - Game successfully loaded^M
[2023-06-18 09:52:42,071] INFO - JoystickManager : Found Load_Cell_Interface_LC-USB, SideWinder_Precision_2_Joystick, vJoy_Device, T500_RS_Gear_Shift^M
- changes described here
Poller.cs
thread class used byThrustmasterLEDControllerPlugin.cs
plugin
1 Feb 2024