Announcement

Collapse
No announcement yet.

Trying to create an "if statement" - translating string into numeric value

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

  • Trying to create an "if statement" - translating string into numeric value

    Hi there,

    I have an interesting challenge that I'm trying to tackle, and I feel like there has to be a clever way to make it work in OSCulator, but I just can't quite figure it out.

    I'm working with the ETC Eos family of lighting consoles, and using a USB Midi controller to control the Eos console via OSC (and OSCulator). The Eos supports bi-directional communication via OSC in order to have a midi controller trigger and control specific playbacks on the lighting console. The midi controller I have sends Midi on/off messages for each button, and also supports receiving Midi messages to turn the button backlight LED on or off, as well as change colors and such.

    Now, the Eos will send back information about playbacks, such as the current level of the playback (message with floating-point argument), and the name of the playback (message with string argument). If the playback is empty, it will send a level of zero, and a blank/empty string argument for a name.

    So here is my ultimate goal: If a playback on the Eos is empty (sends a name string argument that is blank) then I want to send a MIDI message to my controller that turns the LED backlight on the specific button off. If the Eos playback is not empty (has a name string that is not blank), then it will send a MIDI message that turns the backlight LED on.

    The natural way that I want to tackle this is simply by creating some kind of "if" statement. However, I know this isn't directly possible in OSCulator...
    And the other main problem that I encounter is that it seems OSCulator does not allow routing of a OSC message with a string argument directly to any kind of MIDI message, only to another OSC message.

    So, is there any way that you can think of to basically evaluate the contents of a string argument to be empty or not empty, and then send a different message based on the result?

    The two OSC messages that I receive from the Eos are:
    /eos/fader/1/1 ,floating-point
    /eos/out/fader/1/1/name ,string

    each with just the one argument

    And I'm not able to use the first message with the floating point argument as a tell, because even if a playback on Eos is not empty, the level may still be at zero, and consequently would still send a level of 0, whether the playback was empty or not.

    Does this make sense? I'm attaching an OSC doc that I've started for this project. Also attaching a pdf document that explains more about the Eos OSC commands if that is confusing to anyone...

    Any thoughts or help you have would be great. happy to provide more info if it doesn't make sense.

    Thanks!

    -Brian
    Attached Files
Working...
X