Vinnie Garcia

Heartbeat synthesizer ๐Ÿซ€

Cover the camera with your fingertip
and hold still

-- BPM
Start to allow camera access.
Tap a mode to enable sound
How it worksBack to the demo

Making sound from a camera pulse signal

Cover the active camera with a fingertip and the image can pick up small brightness changes associated with your pulse. This page looks for those changes and uses their timing to make sound or send MIDI clock.

This is a sound experiment, not a medical heart-rate monitor. It isn't calibrated or clinically validated. The BPM can be wrong, unstable, or left over from an earlier reading. Don't use it to assess health, diagnose anything, or make treatment decisions.

Allow camera access and hold still through the roughly ten-second Measuring... countdown. The page tries the rear camera first, then falls back to an available camera. It doesn't turn on a torch. Contact, lighting, and exposure all affect whether there's a useful signal. A wave on the green trace could also be movement or changing light.

Three ways to hear it

Synth plays a short 80 Hz sine tone that fades quickly on each detected crossing. It's responding to detections as they happen, rather than playing a separately scheduled metronome.

Binaural sends 200 Hz to the left channel and 200 + BPM / 60 Hz to the right. At 60 BPM, the difference is one hertz. Headphones separate the channels; keep the volume comfortable. This demonstrates two slightly different tones, with no claim about relaxation, brainwave entrainment, or health benefits.

MIDI Out sends 24 timing-clock pulses per estimated beat to the first available MIDI output. It needs browser support for Web MIDI and a connected device. There's no output picker, and it sends neither notes nor transport-start commands. If an instrument expects a start command, clock alone won't provide it. Browser timers and a changing BPM estimate also make this unsuitable as a precision musical clock.

How a brightness change becomes a beat

Each camera frame is reduced to 20 by 20 pixels, and the green channel is averaged across all 400. The code subtracts a slow, 60-sample moving average from a faster five-sample average. That brings out changes relative to the recent baseline.

A crossing above a fixed threshold counts as a peak only when more than 400 milliseconds have passed since the previous one. After at least three peaks, the code averages the intervals and calculates 60000 / average interval for BPM. It keeps up to eight peak times.

The filtering counts frames, not fixed units of time, so camera and rendering rates affect it. The spacing rule caps resolved detections at roughly 150 per minute, even though the later numeric check accepts values from 40 to 180.

Most importantly, old peaks and the last estimate stay around when fresh detections stop. A steady number doesn't prove the camera is still finding a pulse. Close the page when you're finished.

The outputs use Web Audio and Web MIDI. To go the other direction, from sound to a picture, there's the microphone visualizer.