Forums > MaxMSP

Prevent ctlIn defaulting to "All devices by Channel"

April 4, 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?



pm
April 4, 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.

– Pasted Max Patch, click to expand. –

April 4, 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.


Viewing 3 posts - 1 through 3 (of 3 total)