LoginSignup
0
0

More than 1 year has passed since last update.

Using VRChat OSC to control VRCHAT with a MIDI device

Posted at

Objective

Use MIDI Device(Such as MIDI Keyboard,Pedal) as VRCHAT motion control function(OSC)

Join VRChat Beta program

Open Steam and open VRCHAT property window.
image.png

Choice open-beta - Open Beta
image.png
Close window.
It should be reloading.

Check VRCHAT+OSC is enabled.

Launch VRCHAT at desktop mode.
image.png

Press R hold and click options.
image.png
Make sure you can see OSC menu.
image.png
Click OSC Debug and check it.
image.png
It is OK to proceed next step if you can see this message.
image.png

If you see OSC was turned off in your settings ~~~ at first line....
image.png
Open OSC menu and make sure OSC Enabled is enabled.(Picture's status is disabled)
Just click it and enable it.

image.png

Nice! Let's go next step, DO NOT close your VRCHAT and keep the debug screen up..

Install TouchOSC

https://hexler.net/touchosc#_
image.png
Click GET TOUCHOSC
image.png
Click Windows and Download it

Launch TouchOSC

image.png

If you have money, Why don't you purchase licences?

Connect settings TouchOSC to VRCHAT

Choice TouchOSC EditConnections
image.png

Configure like screenshot as below(FYI, It will NOT work if you set host to "localhost" set "127.0.0.1")
image.png
Done and back to main window.

Add control button

image.png

As a test, add button.
image.png

Create button
image.png

Test sending click event from TouchOSC

Maybe you can check more easily if you put a window side by side.
image.png

Click Run button(▶) in TouchOSC
Animation.gif
You can check that TouchOSC sent button event from OSC to VRCHAT

If you want to close run mode, click a point which locate upright.
image.png

[Main topic] OSC events triggered by MIDI signals

Configure MIDI input in TouchOSC

TouchOSC EditConnectionsMIDI
image.png
Click "Browse" and set MIDI Device output(Send Port)and input(Receive Port)
image.png
Done!

Install MIDI monitoring tool "Protokol"

https://hexler.net/protokol
image.png

Monitor MIDI note data

MIDI note(ex. C1 at keyboard)
image.png
MIDI Control Change(ex. sustain pedal as 64)
image.png

RECEIVE | ENDPOINT(A-Series Keyboard) TYPE(CONTROLCHANGE) CHANNEL(1) DATA1(64) DATA2(79)

`RECEIVE | MIDI (DEVICENAME) TYPE(TYPE NAME) CHANNEL(1) DATA1(ControllNo.:64) DATA2(Velocity:0-127)

These numbers and parameters will be use in MIDI input mapping phase.

Make MIDI input to OSC event

Overall GIF
Animation.gif

  • Click "Button" and show details.
  • Expand MessagesMIDI tab details.

image.png
Enable →Check
Send → Not Check
Receive →Check
Feedback→Check
Connections: 1 OK MIDI input device No.
Trigger : Default OK(as screenshot shows)
Type: if use midi note NOTE_ON, if you use pedals,CONTROL CHANGE
Channel: Choice CONSTANT input channel No. which you checked at monitar(here:1)

Note: Choice CONSTANT input midi note No.(Here, C1key :64)
Velocity: Default OK(x : VALUE)
Scale: Set input range.(0-127)

Test with VRCHAT OSC DEBUG

Click TouchOSC Run(▶) button.
Animation show
In the following animation, Protokol is shown in the lower right to see the MIDI response, VRCHAT's ORC DEBUG screen is running in the background, and OSC DEBUG is running in the lower left.
Here's how it works when I press the C1 (Do) key as a test!
Animation.gif

Assign to VRCHAT motion

Now that we have successfully sent the data to VRCHAT, let's assign the VRCHAT functions.C:\Users\{$USERNAME}\AppData\LocalLow\VRChat\VRChat\OSC\{hogehoge}\Avatars
There is a json for each avatar

This JSON has a parameter called input, and by sending a request with the specified type (Int in this case) in this address, the corresponding function will become available.
By setting the address listed in address as the destination of TouchOSC button events, you can use the avatar function from OSC.
avatername.json
{
"name": "VRCEmote",
"input": {
"address": "/avatar/parameters/VRCEmote",
"type": "Int"
},
"output": {
"address": "/avatar/parameters/VRCEmote",
"type": "Int"
}
},

This time we will use the default Emote function of VRC (avatar/parameters/VRCEmote). (It's like Wave or Die...).
image.png

Click on a TouchOSC button and change the value of ControlName from the default value of button1 in Detail View.
image.png
→The first / should be pulled out and replaced with →avatar/parameters/VRCEmote.
image.png

After making the changes, run TouchOSC again (▶) and press the C1 (Do) key.
Animation.gif

A single parameter may have multiple functions assigned to it. For example, in avatar/parameters/VRCEmote, you can use other functions such as Clap and Die depending on the Int value you give.
To change the Int value, click the TouchOSC button -> right side detail view -> Messages -> OSC -> change the Scale range.
image.png
If we set this to 2, we get ....
image.png

Animation.gif

In closing

I've been using VRCHAT for about two weeks now, and I'd like to thank the community for being so kind to me, and I hope this article will help those of you who are trying to enjoy VRCHAT more.

Reference

Special Thanks

@dokkozo He provided information on the section to assign to VRCHAT motions.
Also, his(her) avatars are super very kawaii, which motivates me.

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0