I recently had a question about how to reset a XY control to its center when the finger is released.
photo.PNG
While this is not a very complicated setup, it requires a rather good knowledge of how everything works. So here is a detailed recipe so everyone can understand more advanced features of OSCulator.
First of all we need to know how to change the position of the XY control.
When registered in OSCulator, this control usually shows up as a /1/xy1 message with two arguments: the x and y coordinates. The extent of those arguments is, like every values in TouchOSC, normalized to [0 1], which means that the center value is {0.5 0.5}. To change the state of a control, TouchOSC must receive a message matching the control's address with the correct arguments. In our case, we need to send the message /1/xy1 with two arguments: 0.5 and 0.5.
The first steps to send this message are the following:
Now that the OSC Routing is created, we need to configure it a bit further:
Usually this control is used in conjunction with MIDI CC messages. When the finger is released, we might want to send those messages as well. To do that, duplicate the /1/xy1/z message two times (hit Command-D), and assign the same MIDI CC messages used for X and Y. Go to the Scalings Page (Command-F) and change the output min and output max values to 64 for both duplicates. 64 is the middle value for MIDI CC messages.
An alternative solution for this last step would have been to send an OSC message to OSCulator itself at address /1/xy1. This would be the equivalent of simulating a message coming from TouchOSC. To do this, in the Parameters window, OSC tab, add the target localhost:8000 in the second slot of table at the top. Then, copy the routing already defined, change its target to 2 and name it "Reset MIDI". (see the attached file XY Reset (alt).oscd)
Cam
photo.PNG
While this is not a very complicated setup, it requires a rather good knowledge of how everything works. So here is a detailed recipe so everyone can understand more advanced features of OSCulator.
First of all we need to know how to change the position of the XY control.
When registered in OSCulator, this control usually shows up as a /1/xy1 message with two arguments: the x and y coordinates. The extent of those arguments is, like every values in TouchOSC, normalized to [0 1], which means that the center value is {0.5 0.5}. To change the state of a control, TouchOSC must receive a message matching the control's address with the correct arguments. In our case, we need to send the message /1/xy1 with two arguments: 0.5 and 0.5.
The first steps to send this message are the following:
- Open OSCulator, create a new document.
- Create a layout with a XY control on the first page and upload it to TouchOSC (or use the attached file).
- Configure TouchOSC so it sends Z messages (in TouchOSC's configuration window, tap on Options, then "send 'z' messages). This is important because this will be how we detect when the finger is pressed or lifted.
- Configure TouchOSC Network Settings to send messages to OSCulator.
- Touch the XY control so it registers in OSCulator's list. Two messages are now present : /1/xy1 and /1/xy1/z
- On /1/xy1/z, choose Event Type -> OSC Routing, and Value -> New …
- The Parameters page is now displayed, at the botton, click the + button to add a new routing. In the Memo field, name it "Reset XY" (optional)
Now that the OSC Routing is created, we need to configure it a bit further:
- In the OSC Editor window, change Rewrite Address to /1/xy1
- In the Arguments field, type 0.5 followed by space, then again 0.5 followed by space.
- At the bottom of the OSC Editor, in Route when choose "The value goes from positive to 0". This will send this message when the finger is released.
Usually this control is used in conjunction with MIDI CC messages. When the finger is released, we might want to send those messages as well. To do that, duplicate the /1/xy1/z message two times (hit Command-D), and assign the same MIDI CC messages used for X and Y. Go to the Scalings Page (Command-F) and change the output min and output max values to 64 for both duplicates. 64 is the middle value for MIDI CC messages.
An alternative solution for this last step would have been to send an OSC message to OSCulator itself at address /1/xy1. This would be the equivalent of simulating a message coming from TouchOSC. To do this, in the Parameters window, OSC tab, add the target localhost:8000 in the second slot of table at the top. Then, copy the routing already defined, change its target to 2 and name it "Reset MIDI". (see the attached file XY Reset (alt).oscd)
Cam
Comment