- Added audio confirmation via 3,5 jack

This commit is contained in:
bklronin 2024-06-30 20:35:29 +02:00
parent 58a5b4d07c
commit 795256b870

View File

@ -38,6 +38,7 @@ def determine_host(devices_in: list) -> str:
inports = [mido.open_input(device) for device in devices_in] inports = [mido.open_input(device) for device in devices_in]
print("Listening for messages...") print("Listening for messages...")
os.system(f'speaker-test -t sine -f 261 -l 1')
try: try:
while not master: while not master:
for port in inports: for port in inports:
@ -79,6 +80,8 @@ def relay_midi_host_to_out(host_name, devices_out):
print(f"Listening for messages on {host_name} and relaying to {devices_out}") print(f"Listening for messages on {host_name} and relaying to {devices_out}")
recent_messages = [] recent_messages = []
os.system(f'speaker-test -t sine -f 261 -l 1')
try: try:
last_stop_time = 0 last_stop_time = 0
debounce_delay = 0.05 # 50 milliseconds debounce time debounce_delay = 0.05 # 50 milliseconds debounce time
@ -155,9 +158,6 @@ def main_run():
# Play the beep sound with the calculated frequency # Play the beep sound with the calculated frequency
os.system(f'speaker-test -t sine -f {frequency} -l 1') 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)
print(midi_host_in) print(midi_host_in)