From 58a5b4d07cad29d95fbc9e2aa326291680993673 Mon Sep 17 00:00:00 2001 From: bklronin Date: Sun, 30 Jun 2024 20:26:37 +0200 Subject: [PATCH] - Added audio confirmation via 3,5 jack --- ashost.py | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) 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)