+
Skip to content

blekenbleu/MIDIio

Repository files navigation

MIDIio SimHub plugin:  now with Joystick, Event and Action support

Note:   requires a recent SimHub (9.X) version



For one each MIDI source, destination, and optionally vJoy destination device,
this SimHub plugin can route configured Button, Slider and Knob Control Change (CC) messages,
SimHub game, joystick buttons and axes properties.

'MIDIsends' configures vJoy and MIDI output buttons and axes
value changes as SimHub Event triggers, sending corresponding values as SimHub Action targets.

the Oops Target can mapped from MIDIio Event triggers... displaying as oops property values.

MIDIio source CC values are made available as SimHub properties, e.g.
for tweaking ShakeIt Bass Shaker effects and controlling JSONio:

Similarly, SimHub property values can be rescaled and sent as CCs, vJoy buttons and axes.
Unconfigured CC messages received are optionally echoed to destination MIDI,
enabling those source MIDI CCs to directly control a destination MIDI device.

MIDI C# code evolved from SimHub's User.PluginSdkDemo,
using Melanchall.DryWetMidi's DLL (already in SimHub).

MIDIio optionally uses vJoy to simulate DirectInput Button and Axis inputs,
thanks to C# sample code from @njz3.
MIDI CC and vJoy values can include rescaled SimHub properties,
e.g. ShakeIt Bass Shaker effects and JSONio properties.

Motivation and development How-To's

Notes:

  • This plugin was compatible with SimHub 8.4.3's Controllers input and Control mapper plugins
    • Controller mapping has not been tested with newer SimHub versions.
    • MIDIio can send SimHub Controllers properties e.g. for real DirectInputs to its MIDIout or vJoy devices;
      Do NOT configure vJoy properties from Controllers input;  that would provoke feedback loops!
  • This plugin is incompatible with SimHub's Midi Controllers Input plugin
    • MIDIio wants exclusive access to source MIDI device.
    • 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 its single configured source MIDI device.
  • Unconfigured CCs for this device can be sorted by monitoring CCin in SimHub Available properties.
  • SimHub bundles vJoy DLL v2.2.2.0, which works for me with vJoy driver v2.1.9.1.
    vJoy driver v2.2.2 is available, but I have not tested it with MIDIio...
  • This plugin has NO interactive user interface.
    • configure by editting NCalcScripts\MIDIio.ini, which goes in SimHub\NCalcScripts\ folder

    • check System log for MIDI and/or vJoy related messages:
      log messages
      configuration details logged only forMIDIlog '7'

    • MIDIio neither is (nor will 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 joystick input button as B00;
    • MIDIio configures that first vJoy button for routing as MIDIvJoyB00 in NCalcScripts/MIDIio.ini.
      vJoy
      However, that first vJoy button is B1 in MIDIsends for SimHub Events and Actions
      Here is a minimal vJoy first button Event example:

string vJoy = "set value='0' to disable vJoy outputs"
[ExportProperty]
name='MIDIvJoy'
value='1'

string log = "value=0:  Log only errors;  1:I/O failures;  3:Event issues;  7:verbose"
[ExportProperty]
name='MIDIlog'
value='7'

string event = "SimHub Event and Action mapping"
[ExportProperty]
name='MIDIsends'
value='B1'

string button = "first vJoy button for Event and Action mapping"
[ExportProperty]
name='MIDIsendB1'
value='InputStatus.JoystickPlugin.BavarianSimTec_OmegaPRO_v2_B00'

For testing, this ShakeIt profile has a custom effect with ShakeITBSV3Plugin properties from MIDI sliders.

18 Jun 2023 SimHub v8.4.3 breakage

1 Feb 2024

24 May 2025 version 0.0.1.3

  • tested vJoy axis with JSONio property;  0 to 100 range expected
  • changed example MIDIio.ini to use VKB instead of SideWinder HOTAS
  • test for non-zero MIDIvJoy setting (non-NULL VJD) before logging missing MIDIvJoyButtons or MIDIvJoyAxiss
  • bug fix: test for null Darray[0-1] instead of (never) null Darray

24 May 2025 version 0.0.1.4

  • Release builds generate MIDIio.zip

25 May 2025 version 0.0.1.5

25 May 2025 version 0.0.1.6

  • fix unconfigured source CC logic

25 May 2025 version 0.0.1.7

  • MIDIio.ini comment strings
  • updated .png's
  • rename ping Actions to send

25 May 2025 version 0.0.2.3

  • debug properties: oops, prop, Ping, CCin, CCsent, VJsent, in, out
  • replace fixed size SourceName array by SourceList and ListCC
  • relocated and debugged Sent[][] anti-duplication
  • simplified Send(); move rescale to Active() and SendIf()

30 May 2025 version 0.0.2.4

  • complete replacing arrays based on MIDIsize with Lists
  • fix MIDIecho 4 non-MIDI property logging, eliminating duplicates
  • except 'oops', debug properties only for MIDIecho 4
  • updated docs, adding devices

31 May 2025 version 0.0.2.6

6 Jun 2025 v0.0.3.4

  • MIDIsends changes for vJoy and MIDI Event triggering and Action targets
    broke MIDIio.ini configuration backward compatibility.

8 Jun 2025 v0.0.3.5

  • Act() fixes;&nbsp CC input Action parms all in ActList
  • avoid bogus Log entries if only vJoy Event handling

About

SimHub plugin to read and send MIDI CC and vJoy events

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载