Announcement

Collapse
No announcement yet.

Using a MIDI Note to Send Mouse pointer to a specific coordinate on the screen.

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Using a MIDI Note to Send Mouse pointer to a specific coordinate on the screen.

    I want to press a midi note on my keyboard to tell the mouse to go to a specific point on my screen. I'm not entirely sure how to do this in OSCUlator, but I know that it's potentially possible. Any sort of guidance on achieving this would be helpful and appreciated.

    -g

  • #2
    Hi Greg,

    OSCulator may not be the best tool to do that, but it should not be too complicated to try.

    The first you need to do is to make the note values appear by "demultiplexing" the /midi/note message.

    When OSCulator receives a MIDI note, select the first argument (the one named 'pitch') and choose Edit -> Demux. Then send notes again. You will see that you will then have access to the individual note values.

    Now you can see that each note has a velocity and a trigger. The trigger value changes when a note is received (0 for note off and 1 for note on). If you assign an event to trigger at this stage, the event will be fired when a note is on but also when the note is going off. If you want to make a disctinction between the two, you can repeat the "demux" process again on trigger, in order to differentiate both conditions.

    The second aspect is about moving the mouse. OSCulator provides events to move the mouse from OSC messages. The ones that you are interested in are "Mouse / Absolute Move X" to update the horizontal position of the mouse and one "Mouse / Absolute Move Y" to update the vertical position. They accept a numerical value between 0.0 and 1.0. Therefore, if you want to update the mouse coordinate, you first need to duplicate the trigger message in order to assign two events, one for the X axis, and one for Y.

    Lastly, in order to choose a specific location, you must force the output value for the events. This is done by editing the Output in the Scalings Page. Go to the Scalings Page, press Command-F, and change both Output Min and Output Max for example to 0.1. If you are updating the X axis on a 1280x1024 screen, the mouse pointer will go to 1280 * 0.1 = 128 on the X axis.

    I hope this will help you get started, if you want more details feel free to ask.


    Best,
    Camille

    Comment

    Working...
    X