Creating a unique OSC address for each trigger.

Home Forums Scripts Creating a unique OSC address for each trigger.

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #2253 Reply
    Anonymous
    Inactive

    Hi –

    I’m just getting started with Iannix and have got the hang of basic scripts thanks to the great examples that are included.

    I’m currently trying to build a circular sequencer controller which at its most basic level will send on/off signals to the steps on the sequencer itself. I have run into two issues: one of which I know I can sort out manually but I’d like to know if it’s possible in the script itself, and another which I can’t find any reference to but I think is probably possible.

    Firstly, I’d like the script to be able to automatically change the OSC target for each individual trigger. There are up to 16 triggers, and the general address where they are all sending data is:

    osc://127.0.0.1:57120/track/1/fx/1/fxparam/**

    where ** needs to be a value between 40 and 56; this value corresponds to the 16 steps on the sequencer. What I’d like to do is to have the script dynamically create this value by taking the trigger_id and adding 40 to it (or in my case, since I’m customising the “simple serial example” script, would I use the circleIndex number?). I can’t seem to get this to work, but I’m not sure if it’s because you can’t create parts of an address based on variables, or if I’m just using the wrong syntax. I’m very new at this sort of thing!

    The other thing I want to know is: how can you set a trigger up to switch on on the first pass of a cursor, and off on the next pass? I’m sure this is easy enough to do but the closest I can find in the reference is time based trigger variables.

    Thanks for any help!

    #2788 Reply
    Anonymous
    Inactive

    Hi!

    Thanks for your feedback
    In scripts, can use the “setMessage” function. For your example, just add this line in your cursor creation :

    run("setMessage current 20, osc://127.0.0.1:57120/track/1/fx/1/fxparam/" + circleIndex + " ");

    To switch on or off an object, you can use the setActive function :

    run("setMessage current 20, direct:// setActive  <0|1>");

    Of course, you can mix messages like that (example) :

    run("setMessage current 20, osc://127.0.0.1:57120/track/1/fx/1/fxparam/" + circleIndex + " 1, direct:// setActive " + (circleIndex-1) + " 0");

    Good luck in your sequencer project !

    #2789 Reply
    IanniX
    Keymaster

    Thanks for the help! I’ll try this out tonight.

    One more question (and this probably shows how much of a noob I am): where doea the 20 come from in your examples? (ie “setMessage current 20”).

    Thanks again!

    #2790 Reply
    Anonymous
    Inactive

    It’s a secret!

    20 means “20ms”. The cursor sends OSC each “20 ms”. Simple!

    (so if you need only one info per second, you type setMessage current 1000, ………)

Viewing 4 posts - 1 through 4 (of 4 total)
Reply To: Creating a unique OSC address for each trigger.
Your information:





© IanniX Association

What is IanniX? | Download | Showcase | Forums | Research | About