Repository navigation
Programs: internet radio, MIDI module and Bluetooth speaker for any board - #59
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.