Quering which MIDI device/port is selected for a "midiin"???

Oct 18, 2012 at 2:01am

Quering which MIDI device/port is selected for a "midiin"???

Hey guys,

I want to know if there is some message or something I can send to a “midiin” object so I can retrive the selected MIDI device/port on a “message” object.


Oct 18, 2012 at 5:44pm

I’m not aware of such a message. If this is important, then you should probably use midiinfo to get the list of all available ports, feed it into a umenu (say) and then only change ports through that umenu. That way you would be able to keep track.

Oct 18, 2012 at 5:58pm

Yeap, I have donne that way.

The problem is that in case of device disconnection, device/port changes inside the MIDIin and as far as I know there is no way yo know to wich one till you double click on MIDIin (I know that it is the first available port)

I already did an alarm system that holds last selection on a variable, then check device existence 1 time per second, in case of non existence it changes te “umenu” to red, and text to “Alarm”, anyway I thought that may be there could be some way to know automatically wich port was selected after last selection disappeared.

Thanks anyway!

Oct 19, 2012 at 8:40pm

Hey gbravetti – I have the same problem, with a lot of USB hardware that may ‘disappear’ or not be available and who knows where your control signals will end up.

I also ended up with a midiinfo list, matching the required ports and sending an alarm message if the port doesn’t exist.

At initialisation though I create a ‘dummy’ virtual midi port, midi objects are set to this dummy (doesn’t go anywhere) when the actual device they should connect to cannot be found.

You could also use the enable 0/1 command into your midi objects to just switch them off when your port is not found – but (see discussion elsewhere) even though ‘enable 0/1′ works, it’s not documented and may not work in the future.

Finally – I think the midi objects always default to the top one in the list if the port they are ‘set’ to does not exist.


You must be logged in to reply to this topic.