I am one of a handful of creators who have tried to communicate with Udon from an external process using MIDI.

Here’s me sharing what I learned from trying.

UpkShSw54X.mp4

Why MIDI?

For external processes to send data to Udon, there are only a few ways (non exhaustive):

MIDI, the one we’re interested in, is good for real time, and by real time I mean applications with less than a few milliseconds of delay.

For instance this can be used to sync the position of a real-life tracked object with the world.

Unfortunately, OSC is not an available option despite worlds being mentioned in the corresponding OSC docs.

VRChat Component

Udon can receive MIDI data through the VRCMidiListener component. This component will listen to the first MIDI device it finds, unless a launch parameter is defined that specifies the name of the device to look for. All events are routed to a UdonBehaviour.

For clarity, MIDI events are not networked, so all processing is done on the local machine that sends and receives the MIDI data.

Virtual MIDI devices

I don’t have any MIDI or musical background, I only care about MIDI as a possible way to transmit data from an external process to Udon.

In order for VRChat to receive MIDI messages, we need to create a device we can write MIDI events to. This can be done using a virtual MIDI device, and although apparently it’s natively supported in OSX, in Windows there’s no native support for virtual MIDI devices so you need to install a driver from a third party.

Scouring through the Internet I was not able to find a truly free and open source solution, so we can use proprietary or source-available free-to-download software with some usage restrictions. There are a few mentioned here: https://support.troikatronix.com/support/solutions/articles/13000081815-using-virtual-midi-ports

LoopBe1, and LoopMIDI often come up as results, but personally I’ve used sbvmidi, which worked out. Your mileage may vary.