diff --git a/ashost.py b/ashost.py index 1837c13..1eeeead 100644 --- a/ashost.py +++ b/ashost.py @@ -145,9 +145,18 @@ def main_run(): devices_out = remove_through_ports(devices_out) print("Available MIDI input devices:", devices_in) + base_frequency = 130 # Starting frequency in Hz + increment = 50 # Frequency increment for each device + 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*10} -l 1') + # Calculate the frequency for the current device + frequency = base_frequency + (i * increment) + + # Play the beep sound with the calculated frequency + os.system(f'speaker-test -t sine -f {frequency} -l 1') + + # Add a small delay to separate the beeps + time.sleep(1) # Listen for devices that send start and return the host name midi_host_in = determine_host(devices_in)