Skip to content

Programs: internet radio, MIDI module and Bluetooth speaker for any board - #59

Merged
bdbarnett merged 4 commits into
mainfrom
generic-programs
Nov 11, 2026
Merged

bdbarnett merged 4 commits into
mainfrom
generic-programs

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

Three programs join programs/, each written against the board contract rather than one board's pins: an internet radio for any board with Wi-Fi and audio out, a General MIDI sound module for any board with audio out and a UART (the README shows the optocoupler wiring for a 5-pin DIN input), and a Bluetooth speaker for any board with Bluetooth Classic. They share a small library, lib/programkit, that gives a program the board's roles, one press from whatever touch screen, keys or Boot button the board has, and rows of text on any display.

How each was checked. The speaker played a 10 s tone from a Windows laptop on a QT Py ESP32 Pico with the Audio BFF and an SH1106 OLED (0 underruns, heard in the room at 440 Hz, the OLED showed the sender and battery) and on a Pimoroni Pico Plus 2 W with a Pico-Audio board and a Pico-OLED-2.23 (481,280 frames received, 0 dropped). The radio played SomaFM on the QT Py and on a Waveshare ESP32-P4-WIFI6-Touch-LCD-4B, heard in the room on both. The MIDI module's self-test sent its song through a real UART at 31250 baud on the P4 board and the QT Py; a read of each board's audio pump matched a desktop render of the same bytes through the same engine and SoundFont, and both were heard in the room.

Not checked: no key, touch or Boot button was pressed, so changing station, dropping a sender and all-notes-off are untested on the glass; the Pico Plus 2 W's output wasn't heard (nothing was listening to its audio board); and no MIDI came from a real DIN socket. The QT Py's OLED config and Boot button role are in a pydevices pull request; the Pico Plus 2 W's config is in another.

A program that runs on any board asks the board for what it needs: its roles from board_peripherals (audio factories stay factories), one press from whatever touch screen, keys or Boot button it has, and rows of text that redraw one at a time, through framebuf on a one-bit OLED and pygraphics strips on anything else.
Played a 440 Hz tone from a Windows laptop for 10 s on a QT Py ESP32 Pico with the Audio BFF and an SH1106 (0 underruns, heard in the room at 440 Hz, the OLED drew the sender and battery) and on a Pimoroni Pico Plus 2 W with a Pico-Audio board and Pico-OLED-2.23 (481,280 frames received, 0 dropped; its output wasn't heard).
Played SomaFM's Groove Salad on a QT Py ESP32 Pico with the Audio BFF and an SH1106, and on a Waveshare ESP32-P4-WIFI6-Touch-LCD-4B, each heard in the room with the stream's 64 KB buffer held full.
The self-test's song crossed a real UART at 31250 baud on a Waveshare ESP32-P4-WIFI6-Touch-LCD-4B and a QT Py ESP32 Pico with the Audio BFF. What each board's audio pump played matched a desktop render of the same bytes through the same engine and SoundFont in level and spectrum, and both were heard in the room.
@bdbarnett
bdbarnett merged commit c56c2c6 into main Nov 11, 2026
6 checks passed
@bdbarnett
bdbarnett deleted the generic-programs branch November 11, 2026 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

1 participant