command
module
Version:
v0.0.0-...-7a79955
Opens a new window with list of versions in this module.
Published: Mar 15, 2020
License: MIT
Opens a new window with license information.
Imports: 14
Opens a new window with list of imports.
Imported by: 0
Opens a new window with list of known importers.
README
¶
vrchat-midicon
![License](https://img.shields.io/badge/license-MIT-green.svg)
「VRChat内でオブジェクトを掴んで回すとローカルマシン上のMIDIメッセージ(コントロールチェンジ)として送信される」ギミックを実現するためのコマンドラインツールです。
デモ
![thumbnail](https://pbs.twimg.com/ext_tw_video_thumb/1239081553650569219/pu/img/upW1pRETO6ddJytr.jpg)
しくみ
本プログラムは以下の 4. を行うものです。1. ~ 3. の工程を実現するには、この用途を前提としたVRChatワールドが必要です。画像を参考に作成してください。
-
ワールド内に配置したノブをプレイヤーが回すと、裏面に貼ってあるグラデーションも回る(円錐状に色相が変化する)
-
ノブ裏面のある一点を Camera
が映し、1px四方の RenderTexture
にその色が書き込まれる
-
その RenderTexture
を貼った Quad
をノブの数だけ横に並べておき、それをプレイヤーの Stream Camera で映してデスクトップに表示する
-
デスクトップに表示されている映像をこのプログラムがキャプチャし、ノブの数だけサンプリングした点の色から色相(0..360
)の配列を作成、それをMIDIコントロールチェンジ(0..127
)の配列へ変換してMIDIインタフェースに送信する(色相と値の対応は以下)
色 |
RGB |
値 |
赤 |
#FF0000 |
0.0 |
黄色 |
#FFFF00 |
25.4 |
緑 |
#00FF00 |
50.8 |
シアン |
#00FFFF |
76.2 |
青 |
#0000FF |
101.6 |
マゼンタ |
#FF00FF |
127.0 |
![](https://user-images.githubusercontent.com/61717977/76695278-b8e52380-66c0-11ea-8d35-19e0437e72ea.png)
![](https://user-images.githubusercontent.com/61717977/76695279-ba165080-66c0-11ea-9876-657f30cbc4c6.png)
ビルド
go build -o vrchat-midicon.exe *.go
つかいかた
-
vrchat-midicon.exe list
でMIDI出力ポート一覧を表示
[0] Microsoft GS Wavetable Synth 0
[1] Komplete Audio 6 MIDI 1
[2] loopMIDI Port 2
[3] nanoKONTROL2 3
-
vrchat-midicon.exe start <MIDI出力ポート番号> <CC0> <CC1>
で開始
<MIDI出力ポート番号>
には1.で調べた目的のポートの先頭にある数字を指定
<CC0>
, <CC1>
にはそれぞれ画面左手・右手に映っている Quad
の色と対応するCC番号を指定(ノブ正面から見ると左右が逆になることに注意)
ライセンス
MIT License
Documentation
¶
There is no documentation for this package.
Source Files
¶
Click to show internal directories.
Click to hide internal directories.