From 3993d31f9f36f3b97d4897d58d1b0dab6ef7833d Mon Sep 17 00:00:00 2001 From: bklronin Date: Sun, 30 Jun 2024 20:17:51 +0200 Subject: [PATCH] - Added audio confirmation via 3,5 jack --- ashost.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/ashost.py b/ashost.py index 455ac8f..a0d6aa3 100644 --- a/ashost.py +++ b/ashost.py @@ -1,12 +1,11 @@ #!/usr/bin/env python3 - +import os ### Copyright 2024 Thomas Herrmann ### Released under GPL v3 import time import mido - def match_device_name(input_name, output_list): # Function to match device names flexibly for device in output_list: @@ -16,7 +15,6 @@ def match_device_name(input_name, output_list): #If name differs elif any(substring in device for substring in input_name.split()): return device - return None def remove_through_ports(ports): @@ -25,7 +23,6 @@ def remove_through_ports(ports): return filtered_ports - def determine_host(devices_in: list) -> str: master = None """ @@ -148,6 +145,10 @@ def main_run(): devices_out = remove_through_ports(devices_out) print("Available MIDI input devices:", devices_in) + for i in range(len(devices_out)): + #Try to communicate nr of devices via 3,5 output of raspi + os.system(f'speaker-test -t sine -f 44{i*5} -l 1') + # Listen for devices that send start and return the host name midi_host_in = determine_host(devices_in) print(midi_host_in)