Prevent ctlIn defaulting to "All devices by Channel"


    Apr 04 2011 | 1:39 pm
    Hi I am using a ctlin and binding it to my hardware like so:
    ctlin "SL MkII Port 2"
    The problem I have is that if my hardware is not connected the ctlin will default to
    "All devices by Channel" which is giving me a feedback loop in my patch. I'm guessing I have poll midiinfo and wait until I can see my port before wiring up ctlinfo. Has anyone built such a patch that is 'aware' of hardware connection states? Or maybe there is a more elegant way of doing this?

    • Apr 04 2011 | 4:42 pm
      You can send the message
      port "SL MkII Port 2"
      to the ctlin object with a loadbang. You can also use a coll to globally access your controllers list.
    • Apr 04 2011 | 5:08 pm
      Thanks for the reply. That looks like some good tidy code there. Would it prevent defaulting to all ins if my hardware isn't plugged in?
      My latest thinking since I typed the post is to create a new "null" dummy port on load with
      ;#SM createinport null
      define the ctlin mapped to it
      ctlin null
      then bang a port message into it. If the port message fails, my tests seem to suggest it will revert to the null port and therefore prevent feedback loops.