Can remote scripts access their assigned midi port names
Posted: Tue Apr 08, 2025 4:03 am
Live will log the configured midi remote scripts like this as it is loading a set: (where n = 1 to 7 script slots)
My question is, can a loaded script itself access that data structure at runtime from Python? If so, how?
I "need" to compare the input and output port names a custom script is "currently" using and branch some code depending on whether the names match. (Port names will match when the script is running by itself "independently" and won't match when the script is running in tandem with a Max patch and using a midi loopback port for the remote script output instead of the matching output port which is being used by the Max patch instead.)
I can access self.application.control_surfaces and identify "self" like this:
But that self-identified "script" object can't be subscripted and doesn't seem to have any attributes (or functions). I can't figure out how to do a port name comparison from there. Help, please.
Code: Select all
MidiRemoteScript n [Control Surface="None" Input="None" Output="None"]I "need" to compare the input and output port names a custom script is "currently" using and branch some code depending on whether the names match. (Port names will match when the script is running by itself "independently" and won't match when the script is running in tandem with a Max patch and using a midi loopback port for the remote script output instead of the matching output port which is being used by the Max patch instead.)
I can access self.application.control_surfaces and identify "self" like this:
Code: Select all
control_surfaces = self.application().control_surfaces
for script in control_surfaces:
if script is not None and script == self:
# do something useful