Repository navigation
Redesigned glucose alarm sounds and a per-alarm sound picker - #2597
Conversation
The in-app fallback stopped after a flat 6s, which was a few loops of the old ~0.84s tone but just over half of the new 10.8s urgent-low alarms. Run whole passes of whatever sound is configured instead, up to a floor of 6s and a 30s ceiling.
The display names were plain Swift strings, so nothing in the catalog was reachable by the string catalog: a translated build showed Mild / Medium / Harsh, Acoustic, Voice and all 26 tone names in English. The set-plus-variant label is a format string rather than interpolation, so the separator can move.
The Urgent Low screen had a debug-only arm that substituted a below-threshold value for the next real CGM reading, so the reading it displaced was never evaluated. Replace it with one control on all four alarms, available in every build: the test alert goes out alongside the next reading (the next loop cycle for Predicted Low) under its own identifier, carrying that alarm's configured sound and interruption level. Arming rather than firing immediately is what makes it worth having — it leaves time to lock the phone, turn on a Focus or turn the ringer down first, which is the setup users actually need to check. Issuing it in addition to the normal evaluation, on its own identifier, keeps it clear of the real alarm's episode state, retraction and AlarmKit alarm.
Five things that read wrong on screen: - The picker was titled "Sound" on all four alarms, with nothing saying which one you were editing. Title it with the alarm. - The footer talked about Urgency even when Voice was selected. Describe whichever control the selected set is showing. - "Other Sounds" was a DisclosureGroup, whose chevron is the one a NavigationLink draws, so the row looked like a push. Draw a rotating chevron instead. - Opening that group left the stored pick off screen if it was one of the later tones. Scroll to it. - The Voice row said "Voice" twice, as the row title and again above the segmented control. Also pass the finishing player to the preview delegate, so a preview that ends during the hop to the main actor can't stop the one that replaced it.
LICENSE.md opens by saying exceptions are noted below and is where the graphics exceptions live, so the new sound and voice licences belong on that trail rather than only in a file of their own.
|
Took this for a run in the simulator and measured the bundled files. The picker design holds up well — three rows instead of eighteen, with the control on the selected row, is a real improvement, and keeping the old tones selectable under "Other Sounds" is the right call for upgrades. I've pushed five commits to this branch (details at the bottom). One thing I did not change, because it's a design decision rather than a bug, is the level of the new files. Recording the measurements here so it's a decision rather than an oversight. Level of the new defaultsiOS doesn't normalise notification or alarm audio, so the file level is the alarm loudness. Loudest-1-second RMS, each new default against the tone it replaces:
Peaks say the same thing: the legacy tones sit at −0.3 to −1 dBFS, the themed sets at −8.4 to −14 dBFS. Roughly 13 dB is subjectively something like a quarter the loudness.
Two related oddities in the same measurements:
Bundle and on-device sizeBundled sounds go 4.8 MB → 10.4 MB, and the catalog matches the directory exactly (58 names, 58 files, no orphans either way). Worth knowing that Pushed to this branch
One note for whenever the level work above happens: the Amy files are CC BY-SA 4.0, so a gain pass over them produces an adaptation that stays CC BY-SA 4.0. |
Why
Trio runs the same glucose alert design as
next-devand shipped it to a wide user base. The alert logic held up; the tone set did not. The volume of complaints about the sounds was among the highest Trio has seen in four years — too harsh, too startling, and in several cases actively unpleasant to be woken by. Normalising the existing files did not move the needle, because loudness was never the real problem: the tones themselves were wrong.So we worked with someone active in sound design to build a purpose-made set. These have been GA in Trio since 2026-09-15 and the feedback flipped completely. This PR adapts that work to Loop's
next-devalert system, offered upstream in case it's useful.What changes
Themed sets, written per alarm. Each glucose alarm (Urgent Low, Low, Predicted Low, High) gets its own Acoustic, Electronic and Voice set. These are not one recording transposed — the Urgent Low set is a different piece of sound design from the High set, so the alarm is identifiable before you read the banner.
Urgency is a recording, not a gain stage. Acoustic and Electronic each come in Mild / Medium / Harsh. Each level is its own recording, with increasing dissonance and harsher high/low content to cut through background noise and sleep. Nothing is simply "the same file, louder".
Voice alerts. Spoken alerts in a male and a female voice (Bryce, Amy), generated with Piper, following the example of Loop Follow but with current models and explicit licensing.
Defaults move to Acoustic / Medium for all four alarms. That's the designer's recommendation after hallway testing with adult and child PWDs, and it is the single change that resolved most of the complaints we had.
The picker leads with what fits. The sound list now shows the sets written for the alarm you're editing first, with the urgency slider or voice toggle inline on the selected row. The existing generic tones are all still there, moved under a collapsible "Other Sounds" group that auto-expands if that's where your current pick lives. Each row has its own play/stop preview, and changing urgency auditions the new level immediately.
New generic tones are added alongside the existing ones: Glass Bell, Harp, Meow, Saw Wave, Hard Saw Wave, Sine Wave, Open Can, Open Wrapper. (The cat meow was the single most-requested sound from PWDs under 10.)
Sound design principles used
Upgrade behaviour
The stored value is still just a filename, so nothing needs migrating:
urgent_low.caf/simple.caf/chime.caf/mood_synth.cafto their alarm's Acoustic Medium set. That default change is the point of the PR, but it is a behaviour change on upgrade and worth calling out in release notes.Size and format
40 new
.caffiles, +5.6 MB, IMA4-encoded per the existing bundled tones and the ≤30 s / bundled-.cafconstraint thatCriticalAlertAlarmScheduleralready relies on for AlarmKit. Longest file is 10.8 s. Duration is itself part of the design — Carbs-Required-class tones are short, Urgent Low is long — so the files are shipped exactly as delivered apart from the IMA4 encode.Licensing
ACKNOWLEDGEMENTS.mdis added at the repo root:acoustic_*,electronic_*,glass_bell,harp,meow,saw_wave,hard_saw_wave,sine_wave,open_can,open_wrapper) — CC0 1.0. The author has dedicated them to the public domain, and states that they are the author, that they hold the right to license them, and that the files contain no third-party material they cannot license. They ask to remain anonymous and to be credited as "an anonymous diabetes dad and Trio user" — CC0 does not require that, so it is a courtesy credit inACKNOWLEDGEMENTS.md. That dedication is what lets Loop carry them, not a Trio-only grant.voice_*_bryce.caf) — public domain; the speaker released the training data.voice_*_amy.caf) — CC BY-SA 4.0 via MycroftAI/mimic3-voices, attributed inACKNOWLEDGEMENTS.md. The audio files are under CC BY-SA 4.0; this does not affect Loop's own licence. This is the only ShareAlike asset in the PR — if that is unacceptable here, dropping the Amy files is a self-contained change: the Voice entry collapses to Bryce only.