Prevent ctlIn defaulting to "All devices by Channel"

Apr 4, 2011 at 1:39pm

Prevent ctlIn defaulting to "All devices by Channel"

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 4, 2011 at 4:42pm

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.

– Pasted Max Patch, click to expand. –
Apr 4, 2011 at 5:08pm

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.


You must be logged in to reply to this topic.