Unityã§OSC(OpenSound Control)ã使ãæ¹æ³
ãã¡ãã®Unity 3.4ã§è¿½å ãããã¸ã£ã¤ãã使ã£ããµã³ãã«ããã°ã©ã ã®åç»ã§OSC(OpenSound Control)ã使ããã¦ããã®ãè¦ã¦ããããè¨ãã°Unityã§OSCã使ã£ãæ§ãªåç»è¦ããããªãããåååå ããGame hack-a-thon #4ã§Unityã§OSC使ã£ã¦ã人ãããªããã¨ããã®ãæãåºããããããã£ãã«Unityã§OSCã使ãæ¹æ³ã調ã¹ã¦ã¿ãäºã«ãã¾ããã
ãµã³ãã«ãæ¢ã
æ¤ç´¢ãã¦ã¿ãæããã©ã¼ã©ã ã®ãã¡ãã«ã¦ãµã³ãã«ã³ã¼ããå ¬éããã¦ããæ¹ãè¦ã¤ãã¾ããã
MIDI or OSC for Unity Indie users?
http://forum.unity3d.com/threads/16882-MIDI-or-OSC-for-Unity-Indie-users
沢山ã®ã½ã¼ã¹ã³ã¼ããå ¬éããã¦ãã¾ããä»å㯠unityosc3_753.zip ã¨ãããµã³ãã«ã使ãã¾ããã
usingã®é¨åã§ã¨ã©ã¼ãåºã¦ãã¾ããããã¡ãã®ããã°ãåèã« using System.IO; ã«å¤æ´ããæãç¡äºå®è¡ã§ãã¾ããã
SuperCollider + Unity3d - sc3onlinuxã®æ¥è¨
http://d.hatena.ne.jp/sc3onlinux/20110528/1306573637
OSCã®ã³ã³ããã¼ã©ç¨ã®ã¢ããªãæ¢ã
ä»åãã³ã³ããã¼ã©ã¯iPhoneã使ããã¨æã£ãã®ã§OSCã¢ããªãæ¤ç´¢ããã¡ãã§ããã¤ãç´¹ä»ããã¦ãã¾ããã
iPhoneããªã¢ã³ã³ã«ãã¦ã¿ãï¼2/4ï¼- ï¼ IT
http://www.atmarkit.co.jp/fsmart/articles/input01/02.html
ãã¡ãã®ãã¼ã¸ãä»ã®ãµã¤ããªã©ãè¦ã¦ããã¨ææã§ãã TouchOSC ã¨ããã¢ããªãè©å¤ãè¯ããããªã®ã§ãã¡ããè³¼å ¥ãã¾ããããã¡ãããä»ã®ã¢ããªã§ãæä½åºæ¥ããã¨æãã¾ããä»åã¯ãã¡ãã®ã¢ããªã使ã£ãå ´åã®ä½¿ãæ¹ã®è§£èª¬ã¨ãªãã¾ãã
OSCãããåããã¦ãããã¼ã¿ããã§ãã¯ããæ¹æ³ãæ¢ã
èªåã¯OSCã¯ååç¥ã£ã¦ãããã©ä¸å使ã£ãäºãç¡ãç¶æ ã§ããã
ã¾ãã¯OSCãã©ã®æ§ãªãã¼ã¿ãããåãããã®ãããã§ãã¯ããäºã«ãã¾ããã
ãã§ãã¯ã«ä½¿ããç¡æã®OSCã¢ããªãªã©ãæã£ããè¯ãã£ãã®ã§ããè¦ã¤ãããªãã£ãçºã«Processingã§åºæ¥ãªãã調ã¹ã¦ã¿ã¾ããã
å®ã¯ãããååã®ã¨ã³ããªã¼ã®å ãã¿ã ã£ããã¾ãã
Processingã§OSC(OpenSound Control)ã使ãæ¹æ³ - å¼·ç«ã§é²ã
http://d.hatena.ne.jp/nakamura001/20110807/1312725476
TouchOSCã®è¨å®æ¹æ³
Processingå´ã®è©±ã®åã«TouchOSCã®è¨å®æ¹æ³ã«ã¤ãã¦ç°¡åã«èª¬æãã¦ããã¾ãã
TouchOSCãèµ·åããã¨ãã®æ§ãªç»é¢ã表示ããã¾ããOSCã®é¨åã§æ¥ç¶å
ã®è¨å®ãè¡ãã¾ãã
ä»åã¯Macã¨TouchOSCéã§ã¢ã¯ã»ã¹ããçºãMacã§ç¾å¨ã®IPãこちらで紹介されている様な方法ã§åå¾(ã¾ããã¿ã¼ããã«ã§ ifconfig ã³ãã³ãã§ç¢ºèªãã¦ãè¯ãã§ããâ¦)ãããHOSTãã«è¨è¿°ãã¾ãã
TouchOSCã®ã¤ã³ã¿ã¼ãã§ã¤ã¹ã¯è²ã
ãªãã®ã使ãã¾ããä»åã¯ãBeatmachineãã使ãã¾ããã
å³ä¸ã®ãDoneããã¿ã³ãæ¼ãã¨ã³ã³ããã¼ã©ã表示ããã¾ãã
OSCãããåããã¦ãããã¼ã¿ããã§ãã¯
Processingã§oscP5ã¨ããã©ã¤ãã©ãªãã¤ã³ã¹ãã¼ã«å¾ãä»å±ã® oscP5sendReceive.pde ã¨ãããµã³ãã«ã§ãã¼ã¿ã®ãã§ãã¯ãã¾ããã
TouchOSC ã§é©å½ã«ãã¿ã³ãæ¼ãã¨ä»¥ä¸ã®æ§ãªãã¼ã¿ãéããã¦ããã®ã確èªåºæ¥ã¾ããã
### received an osc message. addrpattern: /1/recenable typetag: f ### received an osc message. addrpattern: /1/recenable typetag: f ### received an osc message. addrpattern: /1/input typetag: f ### received an osc message. addrpattern: /1/input typetag: f ### received an osc message. addrpattern: /1/solo typetag: f ### received an osc message. addrpattern: /1/solo typetag: f
Unityã®ãµã³ãã«ã®è¨å®
èªåãUnityã§OSCã使ãã®ã¯TouchOSCãã³ã³ããã¼ã©ã«ãã¦Unityä¸ã®ãªãã¸ã§ã¯ããæä½ããæ§ãªã·ãã¥ã¨ã¼ã·ã§ã³ãæ³å®ãã¦ããã®ã§ã·ã¼ã³ãã¥ã¼ã® OSCEmpty ã«ããã©ã«ãã§è¨å®ããã¦ãã OSCTestSender.cs ãåé¤ãã代ããã« OSCReceiver.js ã追å ãã¦ä»¥ä¸ã®æ§ãªæ§æã«ãã¾ããã
Inspectorã® OSCReceiver (Script) ã®ãRemote IPãã«ã¯TouchOSCã®ãHOSTãã«è¨å®ããã®ã¨åãIPãæå®ããSend To PortããListener Portãã¯ããããTouchOSCã®ãPort (incoming) ãã¨ãPort (outgoing) ãã®å¤ãè¨å®ãã¾ãã
Unityã®ãµã³ãã«ã§Processingã§ç¢ºèªããæ§ãªãã¼ã¿ã¨åæ§ãªè¨è¿°ãæãã®ã¯ OSCReceiver.js ã®ä»¥ä¸ã®è¨è¿°ã§ããã
handler.SetAddressHandler("/1/toggle1", Example1); handler.SetAddressHandler("/1/toggle2", Example2);
ã¡ã½ããã®å 容ã確èªããæã /1/toggle1 ãªã©ã«éããããã¼ã¿ãå¦çããã¡ã½ããã Example1 ã¨æå®ãã¦ããæ§ã§ãã
ããã§æå®ããã¦ãã /1/toggle1 ã /1/toggle2 ã¯TouchOSCã§ã¯å·¦ä¸ã®ã³ã³ã«å²ãå½ã¦ããã¦ãã¾ããã
ä¸ã toggle1 ä¸ã toggle2 ã§ãã
ããã°ã©ã ãå®è¡ãã¦ãããã®ãã¿ã³ãã¿ããããã¨Unityã®Consoleã«ã¦ãã¼ã¿ãåãåã£ã¦ããäºã確èªåºæ¥ã¾ããã