Presets
Playback
Melody
Sound
Tuning
Sequencer
Camera
Layers
Quality
Model check
The science
What is modelled
A note visualizer. Melodies and chords fall onto the keys as coloured bars (colour is the pitch class, length is the duration). While they sound, the page shows the real spectrum of every string, the summed waveform and the sensory dissonance of the intervals being played, so you can see why a fifth sounds smooth and a minor second rough.
Equations
- Equal temperament:
f(m) = fA4 · 2(m − 69)/12(m is the MIDI number); twelve semitones double the frequency. Just intonation and Pythagorean tuning use frequency ratios from C (for example 5/4 and 3/2); the deviation from equal temperament is1200 log2(f / fET)cents. - Stiff string, partial n:
fn = n f1 √(1 + B n²). Real strings have a small bending stiffness B, so upper partials sit slightly sharp of the harmonic series (stretch tuning). - Hammer strike at a fraction β = 1/8 of the string length:
an ∝ |sin(n π β)| / np, so the 8th partial is missing; each partial decays asexp(−t/τn)with higher partials dying faster. - Wavelength in air
λ = c / fwith c = 343 m/s. Two sinusoids at f1 and f2 produce an amplitude beat at|f2 − f1|. - Sensory dissonance (Plomp-Levelt, Sethares form):
d = a1a2(e−3.5 s Δf − e−5.75 s Δf),s = 0.24/(0.021 fmin + 19), summed over all pairs of partials; pure ratios such as 3:2 line partials up and give dips.
Simplifications
Each key is modelled as one string with ten partials added together (additive synthesis). There is no soundboard, no sympathetic resonance, no two- or three-string chorus and no real hammer dynamics, so it sounds like a clean electric piano rather than a recording. The 3D hammers and strings move to show the physics (strike, decay), they are not a mechanical simulation. The keyboard has 37 keys (C3 to C6). The three checks test the signal processing numerically (FFT of the rendered waveform, partial positions, beat rate read from the squared signal) against the formulas above.