diff --git a/ashost.py b/ashost.py index 3547c65..fa3f8f9 100644 --- a/ashost.py +++ b/ashost.py @@ -10,8 +10,13 @@ import mido def match_device_name(input_name, output_list): # Function to match device names flexibly for device in output_list: - if any(substring in device for substring in input_name.split()): + if input_name == device: return device + + #If name differs + elif any(substring in device for substring in input_name.split()): + return device + return None @@ -45,6 +50,7 @@ def determine_host(devices_in: list) -> str: finally: # Ensure all ports are closed, important to not get a stuck script without errors for port in inports: + print("Inport closing", port) port.close() print("Closed all input ports.") if master: @@ -133,8 +139,6 @@ def main_run(): if matching_output_device: devices_out.remove(matching_output_device) - print(devices_out) - #time.sleep(3) if midi_host_in: relay_midi_host_to_out(midi_host_in, devices_out)