tonguedrum.app v1.4
// real-time modal synthesis · webaudio // 8 inharmonic partials · helmholtz body // no samples · fully procedural

Steel Tongue Drum — Modal Synthesis Engine for Musicians & Developers

Not a sampler. A physics model. Every note is computed in real time from an 8-partial modal resonator bank with Helmholtz body coupling, nonlinear damping, and sympathetic vibration between tongues — entirely in Web Audio, under 30 KB, no dependencies.

latency<8ms
partials/note8
sample rate44.1k
precisionfloat32
scales26
page weight<30 KB
recordingWAV · 2min
licenseMIT
synth/modal-bank.ts
// 8 modal partials of a struck steel tongue:
// (1,1) fundamental + detuned beating partner,
// (2,1) (3,1) (1,2) (4,1) overtones, (5,1) shimmer.
const MODAL_MODES = [
  { ratio: 1.000, amp: 1.00,  Q: 800, type: 'fundamental' },
  { ratio: 1.001, amp: 0.08,  Q: 900, type: 'beating' },
  { ratio: 2.005, amp: 0.24,  Q: 600, type: 'overtone' },
  { ratio: 2.012, amp: 0.04,  Q: 500, type: 'beating' },
  { ratio: 2.998, amp: 0.07,  Q: 400, type: 'overtone' },
  { ratio: 3.520, amp: 0.03,  Q: 350, type: 'edge' },
  { ratio: 4.015, amp: 0.025, Q: 300, type: 'overtone' },
  { ratio: 5.98,  amp: 0.008, Q: 250, type: 'shimmer' },
];

function strike(note, velocity) {
  return MODAL_MODES.map((m) => ({
    freq:    note.freq * m.ratio,
    gain:    velocity * m.amp,
    Q:       m.Q,
    damping: nonlinear(velocity),
  }));
}

The Physics Engine

Most "virtual tongue drums" on the web are sample players: a fixed library of pre-recorded WAVs triggered on key press. They sound the same every strike, they can't retune without a new sample set, and the velocity curve is faked. This is not that.

Each tongue is a parallel bank of eight inharmonic partials driven by a velocity-shaped impulse: a fundamental, a beating partner detuned by ~1 cent for the slow chorusing you hear on real steel, and six overtones at ratios drawn from finite-element analysis of struck tongues — 1.000, 2.005, 2.998, 3.520, 4.015, 5.98. The body itself is modelled as a Helmholtz resonator coupled to the tongue array, which is why low notes pick up that hollow, room-like bloom even with reverb off.

Nonlinear damping means a hard strike doesn't just get louder — it shifts the spectral centroid up and shortens the decay envelope, exactly the way real metal does. And because every tongue is always physically present (just resting), striking one excites sympathetic vibration in its neighbours. Play a fifth and you can hear the third quietly humming along. That single detail is what separates this from every other browser-based virtual drum.

26 Scales, Any Tuning

Modal synthesis means the resonator bank retunes instantly. There is no re-sampling, no pitch-shifting artefact, no transposition lookup table — the partials are computed from the target frequency at strike time. The instrument ships with 26 scales: pentatonic, major, natural minor, Dorian, Phrygian, Lydian, Mixolydian, Aeolian, Locrian, harmonic minor, melodic minor, blues, Akebono, Hirajoshi, Iwato, Insen, Hijaz, Bayati, Saba, Rast, Kumoi, Pelog, Yo, Equinox, Pygmy, Chromatic. Each is browseable at /scales with audio previews and notation. Custom scales can be passed via URL parameters.

Technical Specs

For Composers & Producers

WAV export gives you clean stems straight from the browser — drop them into Ableton, Logic, or Reaper without any conversion. MIDI input is supported via Web MIDI on browsers that expose it, so you can play the instrument from a hardware controller and capture the audio in one pass. Ambient auto-play mode generates evolving melodic phrases inside the selected scale, useful as a starting point for generative or meditative tracks. The ?embed=1 URL parameter strips the UI chrome so the instrument can be iframed into another site or a kiosk display.

For Developers

The project is vanilla JavaScript by choice — no build step, no node_modules, no transpiler. If you want to learn how modal synthesis actually works in Web Audio, the source is small enough to read in one sitting. The modal bank, Helmholtz body, sympathetic vibration coupling, and reverb impulse generator are all in plain ES modules. View the source of any page, read the data attributes on the canvas, or browse the live instrument with DevTools open. It is one of the smallest serious modal synthesis implementations on the public web.

// 26 scales · 8 partials · <30 KB · no install $ open the instrument →