Announcement

Collapse
No announcement yet.

Empty String detection

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

  • Empty String detection

    Salut Camille and community,


    Is there currently a way to NOT let an empty string pass through the OSCulator routing? I notes that amongst the options, there were only numerical "filters" (like 'only when 0.5 and over'). Is there currently any way to avoid updating a field that is sending a) an empty string and b) a null value (if that exists), and c) a string that only consists of space(s)?

    That would be mighty helpful !


    Merci,

    Freddy

  • #2
    Hi Freddy,

    I am sorry but OSC routing predicates only work for numerical arguments.
    Maybe there is another solution, could you tell what you need to filter?


    Best,
    Cam

    Comment


    • #3
      Hi Camille,

      I want to "intercept" a program's command line echo... what currently happens is that _until_ the command is complete, the echo is sent, but as soon as the command is complete/executed, the command line is blanked. So, if I could somewhat _not_ route a), b) and c) (or maybe it's just one of them, at this stage it's hard to guess), then effectively, I would preserve the last completed command line _until_ something else is typed into it, if that makes sense... I guess this could potentially be achieved with an applescript, but I have never tried to intercept/repeat an OSC message that way (how would I go about it? are there example scripts that use the incoming message?), and I don't know if that would add great latency...

      Merci,

      Freddy

      Comment


      • #4
        PS: I was able to achieve what I was after, but only by going outside of OSCulator (which is always less than desirable, as it makes the system unnecessarily complex):



        Here the link to the Quartz Composer File (needs qcOSC from http://hexler.net/software/qcosc) ... currently, I send a copy of the original string (/1/cmdline) to the qcOSC receiver object, which is then sending the desired "backup" value to /1/last_cmdline, but only in case the string becomes " ".

        I don't know if any existing mechanism in OSCulator would allow for this kind of flip-flop sample-and-hold behavior?

        Comment


        • #5
          Hi Freddy,

          Do you have control over the command line application?


          Best,
          Cam

          Comment


          • #6
            What I mean in fact, is that you could pipe your command-line in a string processing utility (awk, sed, etc.) before sending it to OSC.

            Comment


            • #7
              Yes, I guess that would work, but would not be less complex than routing it through Quartz Composer... . I am trying to keep it simple, with as few applications having to run at any one time... Ideally, I would like to just get two strings out of the source application, but I will have OSCulator running anyway, so I thought, other people might like string based features ...

              Comment

              Working...
              X