Skip to content

This simple Python script converts MIDI input to OSC, which you can then implement in your VRChat avatar.

Notifications You must be signed in to change notification settings

imnotpixel/vrchat-midi-to-osc

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 

Repository files navigation

MIDI to OSC

This simple Python script converts MIDI input to OSC, specifically intended to work with VRChat.

Mido and python-osc (and Python) are required. You can install them easily by running the two commands below in your terminal (if you have pip installed). pip install mido pip install python-osc

If you haven't already, check out my guide on how to set up a MIDI visualiser in your avatar here.

How to Use

Using this program is quite straightforward:

  • Run midi_to_osc.py,
  • Look at the list of MIDI inputs (which looks like ['USB-MIDI 0'] in my case) and input exactly as shown the name of the one you wish to listen to, including the number at the end (in my case USB-MIDI 0).

That's it!

How does it work?

This script basically listens to the MIDI input you give it and when it detects a message, either "note_on" or "note_off", it sends a signal, either True or False to a specific URI for the note it just detected. Yes, this means every note has a different URI. The only reason I adopted this method was to achieve complete independence of every key on my VRChat piano visualiser. Currently the URI is structured like this: /avatar/parameters/KeyXXX, where XXX represents a two- or three-digit number (without any leading zeros) which corresponds to the MIDI note number. This signal is then handled further by the avatar.

About

This simple Python script converts MIDI input to OSC, which you can then implement in your VRChat avatar.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages