From c101d53c9cbfd6fb555bd3e4e35372d49244d6c9 Mon Sep 17 00:00:00 2001 From: Brad Barnett <127794626+bdbarnett@users.noreply.github.com> Date: Sat, 7 Nov 2026 05:52:06 -0600 Subject: [PATCH] midiEngine: say on the status line when the sound can't start With no SoundFont, or a sampler that fails to open, a detected keyboard played nothing and the status line only named the keyboard, so it looked like a bug in the keys. The status line now shows the reason (and keeps showing it when a device appears) until the sound is running. Live keys were never gated on a MIDI file: the port is read whether or not a file is loaded. Checked on a GIGA: with audioeffects missing the status line and face both read the error; with it present, 109 files list from /sd/midi, GeneralUser GS opens and a chord from the keys, with no file playing, moves the DAC pin. --- apps/midiengine/__init__.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/apps/midiengine/__init__.py b/apps/midiengine/__init__.py index 091859b..d9e9e8e 100644 --- a/apps/midiengine/__init__.py +++ b/apps/midiengine/__init__.py @@ -164,7 +164,7 @@ def find_banks(): found = banks.candidates(banks.folders(desktop), banks.getenv("SOUNDFONT")) if not found: st["error"] = ("No SoundFont. Put a .sf2 in ~/soundfonts, or set SOUNDFONT to one." if desktop else - "No SoundFont. Put a .sf2 in %s or %s." % (banks.SD_SOUNDFONTS, banks.FLASH_SOUNDFONTS)) + "No SoundFont, so no sound. Put a .sf2 in %s or %s." % (banks.SD_SOUNDFONTS, banks.FLASH_SOUNDFONTS)) return None return found @@ -828,7 +828,8 @@ def setup(t): st["midi"] = watch.text st["midi_told"] = False if watch.text: - status.set_text(watch.text) + # Without a bank the keys play nothing: say that, not just who is plugged in. + status.set_text(watch.text if st["module"] is not None or not st["error"] else st["error"]) elif st["port"] is not None: status.set_text(st["midi"]) setup_timer.deinit() @@ -852,6 +853,8 @@ def close(): scope.on_close(close) found = find_banks() + if found is None and st["error"]: + status.set_text(st["error"]) # plain on the status line too: keys play nothing without a bank if found is not None and len(found) == 1: start_audio(found[0][0]) elif found: