private void timer1_Tick(object sender, EventArgs e) { OscMessage oscMS = new OscMessage(); oscMS.Address = "/analogin/7/value"; osc.Send(oscMS); }
void Update() { OscMessage msg; msg = Osc.StringToOscMessage("/camhead " + camhead.transform.position.x + " " + camhead.transform.position.y + " " + camhead.transform.position.z + " " + camhead.transform.rotation.x + " " + camhead.transform.rotation.y + " " + camhead.transform.rotation.z ); osc.Send(msg); msg = Osc.StringToOscMessage("/ctrlleft " + ctrlleft.transform.position.x + " " + ctrlleft.transform.position.y + " " + ctrlleft.transform.position.z + " " + ctrlleft.transform.rotation.x + " " + ctrlleft.transform.rotation.y + " " + ctrlleft.transform.rotation.z ); osc.Send(msg); msg = Osc.StringToOscMessage("/ctrlright " + ctrlright.transform.position.x + " " + ctrlright.transform.position.y + " " + ctrlright.transform.position.z + " " + ctrlright.transform.rotation.x + " " + ctrlright.transform.rotation.y + " " + ctrlright.transform.rotation.z ); osc.Send(msg); }
public static void SingleServo(int iShield, int jServo, int MaxValue) { string msg = "/unity/single "; OscMessage oscM = Osc.StringToOscMessage(msg); oscM.Values.Add(iShield); oscM.Values.Add(jServo); oscM.Values.Add(MaxValue); handler.Send(oscM); }
void Update() { string[] soundsOnOff = new string [4]; if (soundObject1 != null) { SoundPositions(soundAlgorithm, 1, soundObject1, soundObject1Level); soundsOnOff[0] = "1"; } else { soundsOnOff[0] = "0"; } if (soundObject2 != null) { SoundPositions(soundAlgorithm, 2, soundObject2, soundObject2Level); soundsOnOff[1] = "1"; } else { soundsOnOff[1] = "0"; } if (soundObject3 != null) { SoundPositions(soundAlgorithm, 3, soundObject3, soundObject3Level); soundsOnOff[2] = "1"; } else { soundsOnOff[2] = "0"; } if (soundObject4 != null) { SoundPositions(soundAlgorithm, 4, soundObject4, soundObject4Level); soundsOnOff[3] = "1"; } else { soundsOnOff[3] = "0"; } if (soundAlgorithm == 0) { ListenerAndSpace(); } SourceLooping(); OscMessage onOff = Osc.StringToOscMessage("/onOff " + soundsOnOff[0] + " " + soundsOnOff[1] + " " + soundsOnOff[2] + " " + soundsOnOff[3]); OscMessage srcName = Osc.StringToOscMessage("/sourceName " + soundName1 + " " + soundName2 + " " + soundName3 + " " + soundName4); oscHandler.Send(onOff); oscHandler.Send(srcName); }
public void Send(string prefix) { string message = prefix + myHeadset.message; OscMessage oscM = Osc.StringToOscMessage(message); //Debug.Log(myHeadset.message); oscHandler.Send(oscM); }
// Update is called every frame, if the MonoBehaviour is enabled. void Update() { //Debug.LogWarning("time = " + Time.time); OscMessage oscM = Osc.StringToOscMessage("/test1 TRUE 23 0.501 bla"); oscHandler.Send(oscM); }
// Update is called every frame, if the MonoBehaviour is enabled. void Update() { //Debug.LogWarning("time = " + Time.time); OscMessage oscM = Osc.StringToOscMessage("/1/push1"); oscHandler.Send(oscM); }
void Update() { string message = ""; OscMessage oscM = null; oscM = Osc.StringToOscMessage("/" + message); handler.Send(oscM); }
/// <summary> /// Update is called every frame, if the MonoBehaviour is enabled. /// </summary> void Update() { //Debug.LogWarning("time = " + Time.time); OscMessage oscM = Osc.StringToOscMessage("/wek/inputs " + Input.GetAxis("Vertical") + " " + Input.GetAxis("Horizontal")); Debug.Log("/wek/inputs " + Input.GetAxis("Vertical") + " " + Input.GetAxis("Horizontal")); oscHandler.Send(oscM); }
public void SendOSCMessage(string data) { // data is a string with the addr followed by the message parms seperated by " "'s // example: "/test1 TRUE 23 0.501 bla" Debug.Log("sending: " + data); OscMessage oscM = Osc.StringToOscMessage(data); oscHandler.Send(oscM); }
public void SendOscMessage(string content) { string text = string.IsNullOrEmpty(address) ? content : address + " " + content; OscMessage msg = Osc.StringToOscMessage(text); oscHandler.Send(msg); SenderPrinter.Invoke(text); }
void Start() { UDPPacketIO udp = GetComponent <UDPPacketIO> (); udp.init(remoteIp, sendToPort, listenerPort); osc = GetComponent <Osc> (); osc.init(udp); OscMessage msg = Osc.StringToOscMessage("/startup"); osc.Send(msg); }
/* void OnDisable() { // close OSC UDP socket Debug.Log("closing OSC UDP socket in OnDisable"); oscHandler.Cancel(); oscHandler = null; }*/ // Start is called just before any of the Update methods is called the first time. void Start() { UDPPacketIO udp = GetComponent<UDPPacketIO>(); udp.init(remoteIp, 9000, 8000); oscHandler = GetComponent<Osc>(); oscHandler.init(udp); if (Application.loadedLevelName != "Date") { print("WHAT"); OscMessage oscM = Osc.StringToOscMessage ("/2"); oscHandler.Send (oscM); } //oscHandler.SetAddressHandler("/hand1", Example); }
void Update() { _emg01.text = str3[0]; _emg02.text = str3[1]; _emg03.text = str3[2]; _emg04.text = str3[3]; _emg05.text = str3[4]; _emg06.text = str3[5]; _emg07.text = str3[6]; _emg08.text = str3[7]; if (Input.GetKeyDown(KeyCode.A)) { handler.Send(Osc.StringToOscMessage("/imu")); print("A key was pressed"); } }
/// <summary> /// Update is called every frame, if the MonoBehaviour is enabled. /// </summary> void Update() { //Debug.LogWarning("time = " + Time.time); //OscMessage oscM = Osc.StringToOscMessage("/test1 TRUE 23 0.501 bla"); //oscHandler.Send(oscM); OscMessage msgToSend = new OscMessage(); msgToSend.Address = "/wek/inputs"; //msgToSend.Values.Add(Input.mousePosition.x); //msgToSend.Values.Add(Input.mousePosition.y); msgToSend.Values.Add(8); oscHandler.Send(msgToSend); }
private void OnTripodViewUpdate(Texture2D texture) { Color[] colors = texture.GetPixels(0, 0, texture.width, texture.height); OscMessage message = new OscMessage(); message.Address = RemoteOscAddress; foreach (Color color in colors) { message.Values.Add(color.r); message.Values.Add(color.g); message.Values.Add(color.b); } Debug.Log("Sending osc message with length: " + message.Values.Count + " to " + RemoteHost + ":" + RemotePort); handler.Send(message); }
//////////////////////////////////////////////////////////////////// void Update() { // Check if the state of the leds has changed if (wasLed1On != led1On || wasLed2On != led2On) { hasLedStatusChanged = true; currentChangeSignal = 0; } // If the status has changed, send a specified number of OSC // messages to inform openFrameworks of the change if (hasLedStatusChanged) { if (currentChangeSignal < numberChangeSignals) { OscMessage m = new OscMessage(); m.Address = "/unity/state"; ArrayList state = new ArrayList(); if (led1On && led2On) { state.Add(0); } else if (led1On && !led2On) { state.Add(1); } else if (!led1On && led2On) { state.Add(2); } else if (!led1On && !led2On) { state.Add(3); } m.Values = state; handler.Send(m); } currentChangeSignal++; } wasLed1On = led1On; wasLed2On = led2On; }
/// <summary> /// Start is called just before any of the Update methods is called the first time. /// </summary> void Start() { UDPPacketIO udp = GetComponent <UDPPacketIO>(); udp.init(remoteIp, sendToPort, listenerPort); oscHandler = GetComponent <Osc>(); oscHandler.init(udp); oscHandler.SetAddressHandler("/wek/inputs", Example); // Copy of code from Leap Motion OscMessage msg = new OscMessage(); msg.Address = "/wek/inputs"; msg.Values.Add(8); msg.Values.Add(10); oscHandler.Send(msg); }
void Update() { if (Input.GetKeyDown(KeyCode.A)) { //handler.Send(Osc.StringToOscMessage("/surfaces/Quad1/red 0.1")); //handler.Send(Osc.StringToOscMessage("/surfaces/Quad/green 0.5")); //handler.Send(Osc.StringToOscMessage("/surfaces/Quad1/green 0.1")); //handler.Send(Osc.StringToOscMessage("/surfaces/Quad1/blue 0.5")); //handler.Send(Osc.StringToOscMessage("/surfaces/Quad1/color 0.5,0.5,0.5,0.5")); //handler.Send("/surfaces/Quad 1/red 0.5"); OscMessage message = new OscMessage(); message.Address = "/surfaces/Quad 1/color"; //message.Values.Add(0.5f); message.Values.Add(new Color(255, 125, 0, 255)); handler.Send(message); print("A key was pressed"); } }
public void AllMessageHandler(OscMessage message) { Debug.Log("received message"); //handler.Send("/message received"); string msgString = Osc.OscMessageToString(message); //the message and value combined OscMessage oscM = Osc.StringToOscMessage(msgString); handler.Send(oscM); Debug.Log(msgString); //log the message and values coming from OSC string msgValue = msgString.Split("/"[0])[1]; //Debug.Log(msgValue); //FUNCTIONS YOU WANT CALLED WHEN A SPECIFIC MESSAGE IS RECEIVED switch (msgValue) { case "1": //Debug.Log('we have a match'); dim = orig_dim; break; case "2": //Debug.Log('we have a match'); dim = orig_dim; dim *= 2; break; case "3": //Debug.Log('we have a match'); dim = orig_dim; dim *= 3; break; default: Debug.Log("we dont have a match"); break; } }
public void send(OscMessage oscM) { oscHandler.Send(oscM); }
/// <summary> /// Send out OSC message to be played by Pure Data. /// </summary> public void PlaySoundOSC(string oscString) { OscMessage oscM = Osc.StringToOscMessage(oscString); oscHandler.Send(oscM); }
/* * an example OSC address string would look like: * /servo/1/position * * The second part of an OSC message is a list of values to be sent to the specified address: integers, floats, and strings. * The values in this list are simply separated by spaces, and the list can be arbitrarily long. * Most devices on the Make Controller Kit expect only one value. * * /servo/1/position 512 */ public void oscSend(string text) { OscMessage oscM = Osc.StringToOscMessage(text); handler.Send(oscM); }
public void sendData(string data) { oscHandler.Send(Osc.StringToOscMessage(data)); }
public void Send(string id, string content) { _handler.Send(Osc.StringToOscMessage("/" + id + " " + content)); }
void sendCollision(Transform hit) { OscMessage oscM = Osc.StringToOscMessage("/cube/collision " + transform.position.x + " " + transform.position.y + " " + transform.position.z); oscHandler.Send(oscM); }
void sendMessage(string message) { oscHandler.Send(Osc.StringToOscMessage(message)); }
public void SendNoteOn(int noteNum) { OscMessage oscM = Osc.StringToOscMessage("/noteon " + noteNum + " 120"); oscHandler.Send(oscM); }
public void SetGazedAt(bool gazedAt) { OscMessage oscM = Osc.StringToOscMessage("/looking 1.0"); oscHandler.Send(oscM); }
private void SendMessage(string m) { OscMessage oscM = Osc.StringToOscMessage(m); handler.Send(oscM); }
void Start() { preTime = Time.time; osc.Send(Osc.StringToOscMessage("/begin/ " + 1)); playerBody = player.GetComponent <Rigidbody>(); }