I've just noticed (don't know why it didn't occur to me before....probably because I wasn't trying to make a single patch that connected to three different types of control surface):
There doesn't appear to be any way of querying whether or not a control surface is actually physically connected and communicating with Live. I've been looking through all the control surface components and have skimmed through the python scripts....I can't find a way. This is a serious PITA when trying to restore a Live set that utilizes a control surface that is no longer connected when you reload the file.
I was hoping someone had an idea of how to do what I'm trying, or some helpful input. If there's no way to get this, it seems like a good (and necessary) feature to add.
Cheers
How to detect connected control_surface
How to detect connected control_surface
http://www.aumhaa.com for Monomod and other m4l goodies.
-
- Posts: 119
- Joined: Sat Feb 06, 2010 2:39 pm
- Contact:
Re: How to detect connected control_surface
Hey amounra,
I don't think that Live ever really knows which, if any, control surfaces are physically connected at any one time.
In order to detect a control surface, you'd need to query it, then look for a response - typically done via Universal System Exclusive Device Inquiry (and I am not convinced that all control surfaces even support that). For those that do, you'd need to handle the sysex response (and compare with expected values, if you want to know for sure what kind of controller is actually connected). Even if you're only checking for any response at all (and not bothering to look up manufacturer's ID for example), you'd need to make sure that the the python scripts are not swallowing the sysex. (You might want to have a look at the handle_sysex method from the APC scripts, if you want to start down that road...)
Best,
Hanz
I don't think that Live ever really knows which, if any, control surfaces are physically connected at any one time.
In order to detect a control surface, you'd need to query it, then look for a response - typically done via Universal System Exclusive Device Inquiry (and I am not convinced that all control surfaces even support that). For those that do, you'd need to handle the sysex response (and compare with expected values, if you want to know for sure what kind of controller is actually connected). Even if you're only checking for any response at all (and not bothering to look up manufacturer's ID for example), you'd need to make sure that the the python scripts are not swallowing the sysex. (You might want to have a look at the handle_sysex method from the APC scripts, if you want to start down that road...)
Best,
Hanz
http://remotescripts.blogspot.com/ - an introduction to the Framework classes
Re: How to detect connected control_surface
Yeah, that's pretty much what I'm thinking.
What about the navigation box, though. It doesn't seem to initiate until the APC has actually done something (same with the launchpad)...I was thinking I could query that maybe....I'll take a look at your Framework page, I seem to remember you mentioning something about that....
Basically, I'm just trying to prevent a script from loading if the surface isn't connected (APC40 and Launchpad).
Thanks as always
What about the navigation box, though. It doesn't seem to initiate until the APC has actually done something (same with the launchpad)...I was thinking I could query that maybe....I'll take a look at your Framework page, I seem to remember you mentioning something about that....
Basically, I'm just trying to prevent a script from loading if the surface isn't connected (APC40 and Launchpad).
Thanks as always
http://www.aumhaa.com for Monomod and other m4l goodies.
-
- Posts: 119
- Joined: Sat Feb 06, 2010 2:39 pm
- Contact:
Re: How to detect connected control_surface
If it's just APC40 and Launchpad you're checking for, then handle_sysex should get you there, script-wise. Otherwise, I seem to recall that there is a CS step sequencer included with the M4L examples, which only works with the APC40 and/or Launchpad - perhaps they have a hardware check in there which you could copy?
Best,
Hanz
Best,
Hanz
http://remotescripts.blogspot.com/ - an introduction to the Framework classes