This is a submission for the Presage SmartSpectra SDK Challenge
What I Built
Every music teacher has said it: “You stopped breathing in bar 12.”
Pianists, guitarists, string players and drummers hold their breath through hard passages all the time, and almost never notice.
That breath hold brings stiff shoulders, a rushed tempo and fumbled notes, and it gets much worse when the recording light comes on.
You can’t watch yourself breathe while you’re reading a score. A webcam can, and with SmartSpectra it can tell you which bar.
Breathmark is a desktop practice companion (Electron + SmartSpectra):
- Set up a piece. Enter the tempo, time signature, number of bars, and sections such as rehearsal marks (A · Opening, B · Hard run, …). No sheet music needed.
- Settle (30 s). Sit how you’ll play and breathe normally. Breathmark records your resting breathing activity and pulse for today.
- Play against the built-in metronome. A big bar counter, beat dots and a scrolling chest-movement trace drawn on the bar grid keep you oriented.
- Get a bar map. Your run comes back as something that looks like a score: every bar is colored from breathing freely to guarded to held. A breath mark (’) appears above the bar line where you should breathe, for example “Breathe before bar 10. You held 4.9 s through bars 10–11.”
- Come back tomorrow. Each section gets a trend across runs: still bracing → loosening up → body knows it. Bars that keep needing a breath mark get flagged.
Your fingers can learn a passage days before your body stops bracing for it. Breathmark makes that second kind of learning visible.
Two extras I’m especially happy with:
- Red-light mode. It simulates recording pressure: a blinking REC light, a take number, and no click after the count-in. It then compares your tension with your normal practice runs (“Under recording pressure your breath tension is 1.5× your practice runs, and your pulse peaks +12 bpm higher.”). Nothing is actually recorded.
- A gentle cue. After about 4 seconds of held breath during practice, a soft “’ breathe” glows at the edge of the screen. It’s optional, and it’s always off in red-light mode.
Demo
1. A real SmartSpectra run, no simulation
The real SDK running inside the app: API key, piece setup, the SDK’s framing hints, a 30-second settle baseline from real pulse and breathing, the live chest-breathing trace on the bar grid, and the report.
A short CC BY test clip stands in for the webcam (face blurred on screen; the SDK sees the full frames).
2. The full tour (Demo mode)
A 2½-minute captioned walkthrough on simulated signals, so you can see a breath hold on cue: the hard passage, the “’ breathe” cue, breath marks, progress across days, and red-light mode.
Video 1 test clip: by Fury ARA (YouTube), licensed CC BY 3.0, via the Internet Archive. Used unmodified as camera input; blurred on screen.
No key? No camera? Click Add demo piece → Load sample history (or Demo run). Everything runs on clearly labelled simulated signals, so you can explore the whole app in two minutes.
Code
’ Breathmark
Find the bars where you stop breathing.
Breathmark is a practice-room companion for musicians. You play a piece against its metronome while your webcam watches you. Using the Presage SmartSpectra SDK, it maps every bar where you held your breath or your pulse climbed onto a score-like bar map. It then suggests where to pencil in a breath mark (’).
Play the piece again tomorrow and Breathmark shows which passages your body has learned and which it still braces for, even after your fingers know the notes.
Why
Teachers say “keep breathing!” about hard passages all the time. Pianists, guitarists, string players and drummers routinely hold their breath through tricky runs without noticing That tension stiffens the shoulders, rushes the tempo and gets much worse under performance pressure (“red-light fever” when the recording light comes on) You can’t watch yourself breathe while you read music. A camera…
npm install && npm start. Paste your Presage API key in Settings & privacy, or use Demo mode. Requires Node 20+ on Windows x64, macOS Apple Silicon or Linux.
How It Responds to Human Signals
Breathmark requests breathingMetrics + cardioMetrics through the SDK’s Electron renderer integration (bindSmartSpectraIpc in main, the SDK preload, and the renderer SmartSpectraSDK).
Lining up the body with the bar grid. The WebAudio metronome schedules clicks with a look-ahead scheduler and reports the epoch time at which bar 1 / beat 1 sounds.
SmartSpectra timestamps every measurement in epoch microseconds, so each chest-trace sample maps onto an exact bar and beat.
Breath holds from breathing.upperTrace. I first tried a rolling standard deviation of the chest trace, and it failed in an instructive way: a 2.5-second window that happens to sit on the top of a breath looks “still”.
Breathmark now measures breathing activity as the chest’s mean absolute speed over 2.5 s, as a ratio to your settle baseline. That has three advantages:
- it doesn’t depend on where in the breath cycle the window falls;
- it ignores slow posture drift;
- it reads near zero during a hold at any chest level. Players often freeze half-way through an inhale, which an amplitude-around-the-mean measure misses.
Below 30 % of rest for 3.5 s or more counts as a hold, and below 55 % as guarded. Shorter pauses, like the natural one at the end of an exhale, are ignored.
Unit tests check that a 7-second hold lands on the right bar, that a mid-inhale freeze is caught, and that slow (8/min) and fast (20/min) breathing never trigger false holds.
Pulse from cardio.pulseRate. The SDK reports a 12-second rolling average, so Breathmark shifts it back 6 s to line up with the bars that caused it. It then reports each section’s pulse relative to your resting pulse, not as an absolute number.
Signal quality from validationStatus. The status is turned into friendly framing hints (“Tilt the camera so your shoulders and upper chest are visible”).
The settle countdown pauses while the signal isn’t usable. Bars where the SDK can’t see you (no face, chest not visible, too dark or too bright) are shown hatched as no data and are never counted as “calm”. Testing against the real SDK taught me one more thing: it keeps streaming the chest trace through motion warnings, and musicians move while they play. So Breathmark keeps those samples. Motion can only make a hold look like breathing, never the reverse, so the worst case is a missed breath mark, never a false one.
Prize Categories
Best Thoughtful Real-World Use. It answers a real, everyday question that musicians and teachers already ask (“where am I tensing up?”), and it turns the answer into something a musician already uses: a breath mark pencilled into the score.
Most Creative or Delightful Use. The output is a score, not a dashboard. Red-light mode turns a performance-anxiety cliché into a practice tool.
Consent and Data Handling
- Camera consent. A first-run consent screen explains everything below and must be accepted. The camera turns on only when you press Start camera in a session and turns off when you leave it. Electron is configured to grant only video (never the microphone), and only to the app’s own local page.
- Video is processed on-device by the SmartSpectra SDK. Breathmark never stores, records or uploads video or images. Red-light mode only simulates recording.
- Stored locally only. Pieces and runs (per-bar scores, a 10 Hz chest trace, pulse estimates and the settle baseline) live only in the app’s local storage on your computer. There is no Breathmark server, account or analytics. Each piece keeps its latest 30 runs.
- Delete and export. Delete single runs or pieces, or use Settings → Delete everything (data, saved key and consent). Export all (JSON) gives you your data, with the API key redacted.
- API key. It is held in memory by default. An opt-in “remember” stores it unencrypted locally, and the UI says so. The SDK sends it to Presage for authentication.
- SDK telemetry is off by default (
enableTelemetry: false). If you turn it on, the SDK sends session summaries (SDK version, OS and device, frame and quality statistics, coarse errors) to Presage. These are linked to the API key, never include video or vitals values, and the Settings page explains this. - No AI services are used (no
requestInsight, no LLM calls). - Not medical. It is a practice and wellness aid with no diagnosis, treatment or clinical claims. It is designed for measuring yourself with the camera in plain view, never for monitoring other people.




