Resonaite by Liqian (Eric) Yan · liqianyan.com

Resonaite pulses the middle frequencies of a piece of music 2 to 18 times a second, and a brain signal sets how deep the pulse goes.

Here the signal comes from a recorded session, a simulation running in this page, or a dial you turn yourself. A NeuroSky MindWave headset also works, in Chrome and Edge on a computer.

Bypass plays the original music. ×4 makes the pulse four times deeper, so you can hear what it does.

Source Simulated session, recorded

Band gain applied

waiting for sound

Pulse measured in the sound

waiting for sound

added by the engine the music’s own movement set rate

Signal

no frames yet

Control law

holding

Rate
18.0 Hz
Depth
6.0 %
Band swing
0.9 dB
Bed
−14.0 dB
Noise
−26.0 dBFS
Mode
Signal source

Sleep Scott Buckley

0:00 0:00

How it works

Four parts run in this page, once a second for the signal and continuously for the sound.

Signal flow A source produces eight band powers each second. They become one metric, averaged over five seconds. The control law turns the metric into a depth, a bed level and a noise level. The engine applies them to the music, and the display reads the applied modulation and the output. Sourcerecording, simulation,dial or MindWave8 band powers, 1 Hz Metricengagement β÷(α+θ),alpha share, meditation5 s average Control lawcurve, dead band,rate limitdepth, bed, noise Enginemusic + band × (W + D·sin)+ Haas delay + noiseWeb Audio, stereo Displayapplied gain, measured pulse taps

The control law

Each mode reads one metric and moves along a curve between three settings: deeper pulse, the preset, and a lighter pulse. A dead band around the last value it acted on keeps small wobbles from moving the sound, and the depth can change by at most a fixed amount per second.

ModePulse rateBandMetricDeepest atLightest atDepth rangeDead band

What the display shows

Band gain applied
The gain the engine puts on the music’s middle band right now, in decibels against the original: the bed level plus the oscillator after the slow breathing and jitter. It is read from the audio graph, sample by sample.
Pulse measured in the sound
The envelope of the middle band is taken before and after the engine, on the audio thread, over the last five seconds. The bright line is the spectrum of after divided by before, which cancels the music’s own movement and leaves what the engine did; its peak at the dashed line is the pulse. The dim line is the music’s own movement, for scale. Bypass flattens the bright line.
Signal
The eight band powers from the source, each as a share of their total, with the bands the current metric uses highlighted. In Manual mode the dial replaces them.
Control law
The curve the controller follows. The shaded strip is the dead band, the filled dot is where the curve says the depth should go, and the ring is where it is now; the ring moves toward the dot at the rate limit.

Measured offline

Each track below was rendered through the engine in an OfflineAudioContext, bypassed, on and on ×4, and the pulse was measured from the rendered sound with the same envelope method the display uses.

At the preset depth the pulse is a level change of about 0.4 to 0.8 dB, which is why ×4 exists. At 2 Hz the music’s own swells are ten times larger than the pulse, so the Sleep figures are the least precise.

ModeTrackMusic’s own movementBypassedEngine on×4

The sources

Recorded session replays a stored band-power recording at one frame per second. The recording here comes from the simulator, saved to a file, and the label on the display says so. A recording from a real headset in the same format replaces it without code changes.

Simulated runs that simulator live: a hidden arousal value wanders slowly, engagement rises with it, and alpha share and meditation fall with it.

Manual hands the metric to you. The controller treats the dial’s value exactly as it treats a measured one, dead band and rate limit included.

Headset reads a NeuroSky MindWave over Web Serial at 57,600 baud and parses its ThinkGear packets in the page. It needs Chrome or Edge on a computer.

Music

All fifteen pieces are published on Wikimedia Commons under Creative Commons Attribution licences, checked on each file’s page on 5 December 2026. They were transcoded to AAC and brought to the same loudness (−16 LUFS, linear gain); nothing else was changed. Tempo is measured with a beat tracker and shown only where the music has a steady beat.