- Added audio confirmation via 3,5 jack

This commit is contained in:
bklronin 2024-06-30 20:26:37 +02:00
parent f3e3c701b2
commit 58a5b4d07c

View File

@ -145,9 +145,18 @@ def main_run():
devices_out = remove_through_ports(devices_out) devices_out = remove_through_ports(devices_out)
print("Available MIDI input devices:", devices_in) 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)): for i in range(len(devices_out)):
#Try to communicate nr of devices via 3,5 output of raspi # Calculate the frequency for the current device
os.system(f'speaker-test -t sine -f 44{i*10} -l 1') 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 # Listen for devices that send start and return the host name
midi_host_in = determine_host(devices_in) midi_host_in = determine_host(devices_in)