Skip to content

audiolive: play audioinstruments' instruments and keep their turns going - #8

Merged
bdbarnett merged 1 commit into
mainfrom
audio/new-instruments
Oct 31, 2026
Merged

bdbarnett merged 1 commit into
mainfrom
audio/new-instruments

Conversation

@bdbarnett

Copy link
Copy Markdown
Contributor

audiolive's default instrument, karplus, is gone from the audioinstruments package that the MIP index now serves, so a fresh install broke. The default is now poly106 (see audioinstruments.ALL for the names).

The new instruments only sound while fill() is called every 10 to 20 ms: notes, knobs and voices parking reach the sound there. LiveAudio now runs a periodic machine.Timer (TURN_MS, 10 ms) that gives each playing instrument its turn, guarded against re-entry because a Timer tick runs between the app's own bytecodes. It stops on stop() and recover(). Where there is no Timer, or an app owns the time, call live.service() from your own loop; set TURN_MS to None to start no timer.

Checked: on the unix build a poly106 note is silent without turns (peak 0) and sounds with service() (peak 11214). On an ESP32-P4 with the audio pump, a held poly106 note read peak 0 with the Timer stopped and about 3000 to 4300 with it running, no turn errors. On that board poly106 through the pump ran at 127 percent of a block with no effects, so it starved; that is the instrument's cost at 48 kHz, not the turns.

@bdbarnett
bdbarnett merged commit 6c86a20 into main Oct 31, 2026
2 checks passed
@bdbarnett
bdbarnett deleted the audio/new-instruments branch October 31, 2026 11:41
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