IEnumerator sendHTdata() { while (true) { if (quat) { // the quaternion output represents the rotation in the world's space, not the object's one - can't be used for ht client.Send("/rendering/quaternions", transform.rotation.w, transform.rotation.x, transform.rotation.y, transform.rotation.z); } if (standard) { client.Send("/rendering/htrpy", transform.localEulerAngles.z, transform.eulerAngles.x, transform.eulerAngles.y); } if (RollPitchYaw) { float roll = convertDegree(transform.localEulerAngles.z) * -1; float pitch = convertDegree(transform.localEulerAngles.x) * -1; float yaw = convertDegree(transform.localEulerAngles.y); client.Send("/rendering/htrpy", roll, pitch, yaw); } // wait before sending another OSC message yield return(new WaitForSeconds(sendFrequency)); } }
void Update() { float sourcePosX = _audioSourceObject1.transform.position.z; float sourcePosY = _audioSourceObject1.transform.position.x * -1; float sourcePosZ = _audioSourceObject1.transform.position.y - 1.5f; client.Send("/RoomEncoder/sourceX", sourcePosX); client.Send("/RoomEncoder/sourceY", sourcePosY); client.Send("/RoomEncoder/sourceZ", sourcePosZ); }
IEnumerator Start() { // IP address, port number //var client = new OscClient("127.0.0.1", 9000); var client = new OscClient("225.6.7.8", 9000); // Test Blob { yield return(new WaitForSeconds(0.5f)); var msgs = new OscMessage[] { new OscMessage("/test/bundle", 0, 1f, true, "blob 0"), new OscMessage("/test/bundle", 1, 2f, false, "blob 1"), }; client.Send(msgs); } // Test OscMessage { yield return(new WaitForSeconds(0.5f)); var msg = new OscMessage("/test/oscmessage", 1, 2f, true, "text"); client.Send(msg); } // Test bool value { yield return(new WaitForSeconds(0.5f)); client.Send("/test/bool", true); client.Send("/test/bool", false); yield return(new WaitForSeconds(0.5f)); } // Send two-component float values ten times. { for (var i = 0; i < 10; i++) { yield return(new WaitForSeconds(0.5f)); client.Send("/test", // OSC address i * 10.0f, // First element Random.value); // Second element } } // Terminate the client. client.Dispose(); }
private void loadStimulus() { string msg = audioFileManager.audioFilePaths[dataManager.currentStimulus]; // send data to renderer to load next file client.Send(buttonAddress, msg); }
public void SendButtonMsg() { client = new OscClient(IPAddress, oscPortOut); string buttonAddress = "/button"; client.Send(buttonAddress, buttonmsg); }
public void sendData(string msg) { // This method is used to send OSC data to the SALTE audio renderer Debug.Log(buttonAddress + "/" + msg); client.Send(buttonAddress, msg); }
IEnumerator Start() { // IP address, port number _client = new OscClient("127.0.0.1", 9000); // Send two-component float values ten times. for (var i = 0; i < 10; i++) { yield return(new WaitForSeconds(0.5f)); _client.Send("/test", // OSC address i * 10.0f, // First element Random.value); // Second element } }
public void SendAndReceiveMessage() { using (var server = new OscServer(9001, new IPEndPoint(IPAddress.Any, 0))) using (var client = new OscClient(new IPEndPoint(IPAddress.Loopback, 9001))) { var method = new OscMethod(new OscAddress("/abc"), Callback); server.AddMethods(method); server.Start(); var addressPattern = new OscAddressPattern("/abc"); var arguments = new OscValue[] { new OscString("Hello World.") }; var message = new OscMessage(addressPattern, arguments); client.Send(message); Thread.Sleep(100); } Assert.True(messageReceived); }
public void sendData() { client.Send(buttonAddress, msg); }
public void Send(int data) { client.Send(oscAddress, data); }
public void SendData() { client = new OscClient(IPAddress, oscPortOut); client.Send(oscAddress, sliderIndex, sliderValue); Debug.Log(oscAddress + ":" + ":" + sliderIndex + ":" + sliderValue); }
void RandomStringMessage() { var str = m_StringElements[Random.Range(0, m_StringElements.Length - 1)]; m_Client.Send(RandomAddress(), str); }
public void sendData() { client.Send(buttonAddress, slider_index, value); }