Announcement

Collapse
No announcement yet.

How to reset a XY control to the center

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to reset a XY control to the center

    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:
    1. Open OSCulator, create a new document.
    2. Create a layout with a XY control on the first page and upload it to TouchOSC (or use the attached file).
    3. 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.
    4. Configure TouchOSC Network Settings to send messages to OSCulator.
    5. Touch the XY control so it registers in OSCulator's list. Two messages are now present : /1/xy1 and /1/xy1/z
    6. On /1/xy1/z, choose Event Type -> OSC Routing, and Value -> New …
    7. 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:
    1. In the OSC Editor window, change Rewrite Address to /1/xy1
    2. In the Arguments field, type 0.5 followed by space, then again 0.5 followed by space.
    3. 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
    Attached Files
    Last edited by camille; 02-26-2012, 02:19 PM.

  • #2
    Cool! Now I can make a pitchwheel which I thought would be impossible!

    Comment


    • #3
      The XY Reset and a number of other examples are now located in the Samples Library folder within the OSCulator ƒ folder that you get when you download from the website.

      Comment


      • #4
        hi Camille, thans for the explanation. I would like to add that one needs to enable z messages to be sent from the ipad or iphone, this is in the options on the ipad itself, this might be obvious to others but took me a while to work out

        i have a question: i have used this to make a pitch bend wheel that snaps back to the middle (in this case i set the min and max outputs to 8191.5, also note that pitch bend is classed as a "midi note"). my question is: is it possible to have the ipad fader also snap back to zero when it is released?

        additionally i am using this setup to control VSL orchestral instruments, the signal goes from touchosc, to osculator, then to logic on the record enabled mid track, then to Vienna Ensemble Pro which is hosting all of my virtual instruments. i do not see how i can get any feedback using this method, which i can accept.

        thanks in advance for any help you can provide.

        Comment


        • #5
          Hi Amory,

          The instruction for enabling the Z messages is the second item in the tutorial. Maybe it was not clear enough, sorry.

          Yes, you can easily build a fader that resets back to 0 by following the tutorial.
          Here are the instructions rewritten for a fader:

          The first steps to send this message are the following:
          1. Create a layout with a fader control on the first page and upload it to TouchOSC.
          2. Configure TouchOSC so it sends Z messages (see configuration on the first screen). This is important since this will be how we detect when the finger is pressed or lifted.
          3. Open OSCulator, create a new document and configure TouchOSC network settings to send messages to OSCulator.
          4. Touch the fader control so it registers in OSCulator's list. Two messages are now present : /1/fader1 and/1/fader1/z
          5. Select the message /1/fader1/z, choose Event Type -> OSC Routing, and Value -> New …
          6. The Parameters page is now displayed, at the botton, click the + button to add a new routing. In the Memo field, name it "Reset Fader" (optional)

          Now that the OSC Routing is created, we need to configure it a bit further:
          1. In the OSC Editor window, change Rewrite Address to /1/fader1
          2. In the Arguments field, type 0 followed by space.
          3. 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.

          ps: I don't think there is an easy way to have bi-directional communications with Logic using basic mappings (control surfaces like Mackie Control on the other hand have bi-directional communication, but are not supported by OSCulator).


          Best,
          Cam

          Comment

          Working...
          X