Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions apps/midiengine/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -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()
Expand All @@ -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:
Expand Down
Loading