DEV Community

Cover image for Glassbreath: blow a glass vessel with your own breathing
Anish Kumar
Anish Kumar

Posted on

Glassbreath: blow a glass vessel with your own breathing

This is a submission for the Presage SmartSpectra SDK Challenge

What I Built

Glassbreath is a desktop app where you blow a glass vessel with your own breathing.

You sit in front of an ordinary webcam. The Presage SmartSpectra SDK watches your chest rise and fall, and every slow breath adds one band of molten glass to a glowing gather on the end of a blowpipe. A deep breath makes a wide band, a short one makes a narrow neck. When you're happy with it, you smile to cut it off the pipe. It cools into a colour picked from your breathing pace, and you can keep it on a small "Cooling rack" gallery on your computer.

There is no score and no goal to breathe faster or slower. It's a toy that happens to make ten slow breaths feel worth doing.

Glassbreath home screen, a turning teal vessel next to the title "Blow glass with your breath"

Breathe Smile Keep
Glowing orange glass on a blowpipe, breath 5 of 10 The vessel cooling from orange into its final colour The finished Sea glass vessel with a "Keep on the rack" button
Each slow breath adds a band to the hot glass. Hold a smile to cut it. It cools into a colour from your breathing pace. Keep it on your rack, saved on this computer only.

Your breathing decides the whole finished piece:

  • Shape. Deeper breaths give a fuller belly, more breaths make it taller, deepening or easing breaths move the widest point up or down, and long out-breaths give a longer neck.
  • Colour. Slow breathing cools into teal and sea glass, quicker breathing into olive, peridot, straw and honey.
  • Pattern. Steady breaths get a white thread or a Venetian-style lattice. Uneven depth gets combed feather waves. A varied pace gets coloured bands, one per breath.
  • Rare finish. About one vessel in eight cools with gold fleck, crackle or opal.

Eight finished vessels in a row, from a wide teal lattice vase to a squat straw-coloured bowl

Once a vessel is done you can pick it up: drag to tumble it in 3D, flick it to keep it rolling, scroll to zoom. The rack keeps each one with its name, date and breath count, and has calm achievements like "Slow breather" or collecting all six glass colours. None of them reward breathing faster.

The Cooling rack: a shelf of kept vessels with names, dates and breath counts

Sounds are all made in code with Web Audio: furnace roar, a glass "tink" for each band, a chime when you cut, and a cooling crackle.

Demo

The video shows a real live session: the consent and data screen, the SDK warming up, nine breaths turning into nine bands, the smile meter cutting the glass, cooling, and the finished Sea glass vessel on the rack.

No webcam or API key? The app has a "Use the sample recording" button that replays a real recorded stream of SDK metrics through the same code, clearly labelled "Sample recording (not live)".

Downloads for Linux, Windows and macOS (Apple Silicon) are on the v0.1.1 release page.

Code

GitHub logo Sarcastic-Soul / glassbreath

Blow a glowing glass vessel with your own breathing, read from your webcam by the Presage SmartSpectra SDK.

Glassbreath

Blow a glass vessel with your own breathing.

A desktop app that watches your chest rise and fall through the webcam, using the Presage SmartSpectra SDK, and turns every slow breath into a band of molten glass. Smile to cut it off the pipe, watch it cool, and keep it on your rack.

Watch the 2-minute demo · Download v0.1.1 for Linux, Windows or macOS. No webcam? The built-in sample recording runs the whole thing.

Glassbreath home screen, with a turning teal vessel next to the title "Blow glass with your breath"

How it works

Breathe Smile Keep
Glowing orange glass on the end of a blowpipe, breath 5 of 10 The vessel cooling from orange to its final colour The finished Sea glass vessel with a "Keep on the rack" button
Each slow breath adds a band to the hot glass. A deep breath makes a wide band, a short one makes a narrow neck. Hold a smile (or press Space) to cut the glass off the pipe. It cools into a colour picked from your breathing pace. Keep it on the "Cooling rack", a small gallery saved on your computer only.

Every breath leaves a mark

Eight finished vessels in a row, from a wide teal lattice vase to a squat straw-coloured bowl

Your…

The README has setup steps (Node 20+, npm install, put your Presage key in .env, npm start), a Linux sandbox note, and a table of every SDK output the app uses. Installers are built by GitHub Actions on every tag.

Stack: Electron, the @smartspectra/node-sdk package, three.js for the glass (lathe geometry plus a custom glass material), and plain JavaScript with no UI framework. The signal code has 49 unit tests.

How It Responds to Human Signals

Glassbreath uses five live SmartSpectra signals, and each one has one clear job:

SmartSpectra output What it does in Glassbreath
breathing.upperTrace Shapes the glass live. Each breath is cut into inhale and exhale, and its depth sets the width of the next band.
breathing.rate Shown as "about N / min" and picks the cooled glass colour.
cardio.pulseRate and arterialPressureTrace A soft glow pulse in the hot glass, timed to your heartbeat, and a small nudge to the glass hue.
face.expression (happiness score) Fills a smile meter. A smile held for about 0.7 s cuts the glass off the pipe.
face.talking Talking pauses the glass, so speech doesn't get blown into the shape.
Validation status and hints The glass freezes and the SDK's own hint ("Place more of the chest in view" and so on) is shown until the picture is good enough.

Here is what the breathing trace looks like from a real 85-second session I recorded with the SDK:

A real 85-second breathing trace from the SmartSpectra SDK: about 30 samples a second, 16 to 19 breaths a minute

On my laptop the trace arrives at about 30 samples a second with about 60 ms delay, which is fast enough that the glass grows while you are still breathing in. The SDK's breathing rate needs some time to settle, so the app shows a "Warming up" furnace until it has had 30 seconds of good picture, then starts counting breaths.

Wiring the SDK

The SDK runs inside the Electron renderer through its preload script. One small module (src/renderer/signals/) owns it, and the rest of the app only listens to plain events like breath, rate, beat, smile and talking:

sdk = new SmartSpectraSDK({
  apiKey,
  requestedMetrics: [...new Set([...breathingMetrics, ...cardioMetrics, ...faceMetrics])],
  enableTelemetry: !!enableTelemetry, // off unless the user switches it on
});
sdk.on('validationStatus', (code, _ts, hint) => processor.handleValidation(code, hint));
sdk.on('metrics', (buf) => processor.handleMetrics(decodeMetrics(buf)));
Enter fullscreen mode Exit fullscreen mode

The processor then turns raw metrics into things the glass can use:

  • Breath detection. The upper trace is normalised over a rolling window, and a slope detector with hysteresis splits it into inhale, exhale and hold. One breath is trough, peak, trough. Its depth is compared with the median of your recent breaths, so a shallow breather and a deep breather both get a full range of band widths.
  • Heartbeat. A small peak detector runs on the arterial waveform and schedules a glow pulse for each beat. The waveform is only used for its rhythm, never shown as a reading.
  • Smile. The happiness score is smoothed, and the cut needs a held smile (with a short grace period for flickers) so a passing grin doesn't end the vessel too early. Space works too.
  • Replay. A recording tool saves a session's metrics (never video) as JSON lines. The replay source feeds them through the exact same processor, which is how the sample recording and most of the tests work.

One real-world snag: the SDK locks the camera's exposure and white balance while it runs, and some Linux drivers keep that lock afterwards, so the next session started very dark. Glassbreath now switches the camera back to automatic exposure after opening it.

Prize Categories

Most Creative or Delightful Use.

Most health-sensing demos turn your body into numbers on a dashboard. I wanted the opposite: take the same live signals and turn them into an object you made. Glassblowing felt right because real glassblowers literally shape the piece with their breath, and the gather on the pipe looks alive when it glows in time with your pulse.

What I think makes it fun:

  • Your breathing is the only controller. There are no buttons to make the glass, just breathe, and smile when you're done.
  • Every vessel is different and readable. You can look at your rack and see which one was the slow, deep evening session and which was the quick one at your desk.
  • It quietly encourages slow breathing (slow breaths make the nicer teal and lattice pieces) without ever telling you how you should breathe.

Consent and Data Handling

  • Consent first. The camera stays off until you press "Turn on camera". Right next to that button the home screen says "Video stays on this computer" and "A toy, not a medical device", and links to a full "How your data is handled" dialog. "Stop", "Finish" or closing the app turns the camera off.
  • On this computer. The SmartSpectra SDK processes video frames locally. Frames are never uploaded or saved.
  • Network. The SDK contacts Presage to check the API key. Nothing else is sent.
  • SDK telemetry is off by default. The consent screen has a switch for the SDK's anonymous usage counts (one summary per session: SDK version, OS, frame counts, error codes; never video or readings). It stays off unless you turn it on.
  • What is stored. Nothing, unless you press "Keep on the rack". Then a picture of the vessel and its shape (band widths, colour, breath count, rounded breathing pace) are saved in the app's local data folder. Pulse is never stored. A small file keeps which achievements and colours you've found.
  • Retention and deletion. Kept vessels stay until you delete them. You can delete one vessel or all of them from the rack.
  • Your API key. If you paste it in the app, it's stored locally, encrypted with the system keychain when one is available.
  • Sharing is manual. "Share" builds a picture card on your computer. Copy, save and post only happen when you press those buttons; posting just opens X or Bluesky in your browser. Breathing pace is left off the card unless you turn it on, and pulse is never on it.
  • No AI services. No LLM or other cloud service is used.
  • Not medical. Breathing and pulse are rough camera estimates used to shape art. Glassbreath doesn't diagnose, treat or advise on anything, and it shows no health judgements: no colour or achievement means "better" or "worse" breathing.

Thanks to Presage for the SDK and to the DEV team for running the challenge.

Top comments (1)

Some comments may only be visible to logged-in visitors. Sign in to view all comments.