Skip to content
mc.creative

Blog / Web development

Dynamics Playground. Compressor, gate & co. made visible.

6 min readMihnea Cojocaru

  • Web development
  • Engineering
Dynamics Playground with the compressor open: tabs for six processors and signal selection at the top, controls on the left, transfer curve with level meters and scrolling waveform with gain reduction on the right.

Compression is hard to hear, but you can see it. A small project from 2022 has grown into a teaching tool I use to show volunteers what compressor, limiter, gate, multiband, de-esser and EQ do to a signal.

Anyone starting out at the mixing desk quickly learns the terms: threshold, ratio, attack, release. What they actually do, on the other hand, is hard to hear. A few decibels less dynamic range barely register on laptop speakers, let alone in a packed hall. That is exactly what makes it hard to explain to volunteers at the desk why a compressor is set this way and not another.

I had already built something for this back in 2022. Now I have rebuilt it, with six processors, animated displays and real music. The goal has stayed the same: you should see what you hear.

Try it: Dynamics Playground live

How it started: the 2022 simulator

The first version was a small project in plain HTML, CSS and JavaScript, without a framework. The idea was already stated in the page's info text back then: compression is often hard to hear, so it helps to make its effect visible on a waveform.

Instead of real music, there was a calculated signal made of a few hundred values: a strong attack at the start, followed by a curve that decays and swells again, similar to an instrument's envelope. This curve ran value by value through the compressor formula. If the level was above the threshold, the excess was reduced according to the ratio. Attack and release smoothed the reduction so it didn't kick in abruptly, and the makeup gain raised the result again.

Everything was drawn on a canvas: the original in yellow, the compressed signal in blue on top, the gain reduction in red from above and a white line for the threshold. Five input fields on the left, the drawing on the right, and every change redrew the picture instantly.

The principle still holds today. But a lot was missing: you couldn't hear anything, there was only one compressor, and the picture stood still. That is exactly where the new version comes in.

Six processors, one principle

At the top you switch processors via tabs, the controls sit on the left, the display on the right. The look is based on the screens of large digital consoles, so what you learn transfers directly to the real desk.

  • Compressor: threshold, ratio, attack, release, gain, soft knee, peak or RMS and a mix control for parallel compression
  • Limiter: brickwall with lookahead, no peak gets past the ceiling
  • Gate and expander: with hold, depth and key filter, so cymbals don't open the tom gate
  • Multiband: four bands with their own compression, and the bands visibly shrink in the graph with the gain reduction
  • De-esser: split or wideband, with a listen button that makes only the sibilants audible
  • Parametric EQ: four bands plus high- and low-pass, draggable points and a spectrum analyser during playback

See what you hear

Every change takes effect immediately, even without sound:

  • The transfer curve shows how input level becomes output level. A yellow dot moves along it in time with the music, and the coloured circles can be dragged directly.
  • The scrolling waveform shows the input as an outline, the output in colour and the gain reduction at the top in orange. You can see the compressor grab on every hit and let go again.
  • Freeze frame: One click stops sound and animation. Then you change a control and see the difference at exactly one moment, instead of chasing a running film.
  • Bypass switches the effect off for a direct A/B comparison.

Real music instead of test tones

At first, even the new version ran synthetic test signals through the processors. That worked, but it sounded like a lab. Now there is a real multitrack recording behind it: “You Know Better” by Hannes Keseberg, which Cambridge-MT provides for educational use. From the 21 tracks, a small script with ffmpeg mixes individual signals: drums, toms, percussion, bass, guitar, keys, vocals and the full mix.

That has a nice side effect: the raw tom mics also pick up snare, kick and cymbals. This bleed is exactly what a gate is supposed to remove, and with real material you immediately see why it doesn't work without a key filter.

Presets for teaching

Every processor has a small library of presets such as “Live vocals”, “Drums punch” or “Toms without key filter”. One click sets the values, selects the matching signal and explains in one sentence what to listen for. A few are deliberately exaggerated, like “Too much!” or the smiley curve on the EQ. You often learn fastest by hearing how it shouldn't sound.

Tech

The framework-free project from back then has become an app with Vue 3, Pinia, TypeScript and Vite, still without a backend. Each processor has its own store, and settings and language are saved in localStorage. The interface is available in German and English.

The heart of it are the DSP classes in plain TypeScript, with no dependency on Vue: filters, transfer curves and one effect per processor. The same classes run twice. In an AudioWorklet they produce the audible sound, and in a Web Worker they pre-calculate the whole loop for the display. That way the picture always matches the sound, and the display keeps running even when nothing is playing.

Unit tests check the maths, for example that the four multiband bands add back up to the original and that no sample gets past the limiter's ceiling. A GitHub Action tests, builds and publishes to GitHub Pages on every push.

What I learned along the way

  • Motion helps, and so does stillness. Animation draws the eye, but to compare you need a still image. Only the freeze frame turned the tool into a teaching aid.
  • Measuring doesn't replace listening. While mixing, the measurements showed why the kick was barely audible: it almost always plays at the same time as the snare. An artificial click layer made it measurably louder, but it sounded worse. In the end, the ear decides.
  • One calculation for picture and sound. If the display had its own simplified formula, sooner or later it would show something different from what you hear. Shared DSP classes prevent that.
  • Small usability details matter. Larger grab areas for the points, a signal that stays selected when you switch processors, a sticky header while scrolling: none of these little things stand out as long as they work.

My takeaway

Dynamics processing isn't rocket science, but it is invisible. As soon as you see a gate open or a limiter catch the peaks, the terms fall into place by themselves. That is exactly what the Dynamics Playground is for: trying things out, comparing and understanding before you stand at the real desk.

Mihnea Cojocaru at the office

Mihnea Cojocaru

Full-stack developer | sound engineer in Bonn with high standards for clean engineering and good usability.