Start here: play a few keys (or tap them), then open Chords and press Play chord.Play with the letter keys (A W S … = C C♯ D …) · Space sustain · ← → octave · Esc stops the demo
Note –f – HzKey C major
Keys: C3–E5

Notes, octaves and the keyboard

Western music uses 12 pitch classes per octave: C, C♯/D♭, D, D♯/E♭, E, F, F♯/G♭, G, G♯/A♭, A, A♯/B♭, B. On the keyboard the white keys are the natural notes and the black keys the sharps/flats, grouped in twos and threes; C is always the white key just left of a group of two black keys. A full piano has 88 keys from A0 (27.5 Hz) to C8 (4186 Hz). Octave numbers (scientific pitch notation) change at C, so the note above B3 is C4 (“middle C”).

An octave is a doubling of frequency. The interval between adjacent keys is a semitone (half step); two semitones make a tone (whole step).

Equal temperament and A4 = 440 Hz

Modern pianos are tuned in 12-tone equal temperament (12-TET): each semitone multiplies frequency by the same ratio $2^{1/12}\approx1.059463$. Numbering the piano keys $n = 1$ (A0) to $n = 88$ (C8), with A4 as key 49:

$$f(n) = 440\ \text{Hz}\times 2^{\,(n-49)/12}$$

Equivalently with MIDI note numbers $m$ (A4 = 69, middle C = 60, and $n = m-20$): $f = 440\cdot2^{(m-69)/12}$. Intervals are often measured in cents: 100 cents per equal-tempered semitone, $1200\log_2(f_2/f_1)$ cents in general. A just (pure) perfect fifth is 3:2 = 701.96 cents; the tempered fifth is 700 cents, about 2 cents narrow, which is why fifths on a piano beat slowly.

The tone of this piano is synthesised: each note is built from harmonics whose amplitudes follow a string struck at one-eighth of its length (partial $k$ has amplitude $\propto |\sin(k\pi/8)|/k$), with a brightness filter that closes as the note decays, slightly detuned unison strings, a hammer “thump” and longer decay for bass notes. As on a real piano, the top 1½ octaves have no dampers. Real piano strings are also slightly inharmonic, which this model ignores.

Intervals

SemitonesIntervalExample from CRatio (just)
0Perfect unison (P1)C–C1:1
1Minor 2nd (m2)C–D♭16:15
2Major 2nd (M2)C–D9:8
3Minor 3rd (m3)C–E♭6:5
4Major 3rd (M3)C–E5:4
5Perfect 4th (P4)C–F4:3
6Tritone (A4/d5)C–F♯45:32
7Perfect 5th (P5)C–G3:2
8Minor 6th (m6)C–A♭8:5
9Major 6th (M6)C–A5:3
10Minor 7th (m7)C–B♭16:9
11Major 7th (M7)C–B15:8
12Octave (P8)C–C2:1

Scales and keys

The major scale follows the step pattern W–W–H–W–W–W–H. Starting the same pattern on different notes of the major scale gives the modes: Ionian (major), Dorian, Phrygian, Lydian, Mixolydian, Aeolian (natural minor) and Locrian. The harmonic minor raises the 7th degree of natural minor (creating a leading note and an augmented 2nd), and the melodic minor (ascending) raises the 6th and 7th. Pentatonic scales use five notes and are central to many African, Asian and folk traditions; the blues scale adds the ♭5 “blue note” to the minor pentatonic.

A key signature lists the sharps or flats of a major key and its relative minor. Sharps are added in the order F C G D A E B, flats in the order B E A D G C F. Moving clockwise around the circle of fifths adds one sharp (or removes one flat). The relative minor starts on the 6th degree of the major scale (three semitones below the tonic) and shares its key signature: C major → A minor, F major → D minor.

Chords

A triad stacks two thirds: major (M3 + m3, e.g. C–E–G), minor (m3 + M3), diminished (m3 + m3) and augmented (M3 + M3). Adding another third gives seventh chords: dominant 7th (major triad + m7, e.g. G7 = G–B–D–F), major 7th, minor 7th, half-diminished (m7♭5) and diminished 7th. An inversion puts a note other than the root in the bass: 1st inversion has the 3rd in the bass, 2nd inversion the 5th, 3rd inversion the 7th.

In a major key the diatonic triads are I, ii, iii, IV, V, vi, vii° (upper case = major, lower = minor, ° = diminished). The dominant (V or V7) pulls strongly back to the tonic (I) because its 3rd is the leading note, a semitone below the tonic. Benga, the guitar-driven popular music of Kenya, and much Afro-pop often cycle quickly through I, IV and V with a bouncing bass and interlocking picked guitar lines, which you can hear in the Benga bounce rhythm (a simplified illustration).

Cadences

A cadence is the pair of chords that ends a phrase, like punctuation in a sentence.

CadenceChordsEffect
Perfect (authentic)V–IFinal and complete, like a full stop: G–C in C major.
PlagalIV–IA softer close, the “Amen” of hymns: F–C.
Imperfect (half)any chord–VEnds on the dominant and sounds unfinished, like a comma: C–G.
Interrupted (deceptive)V–viThe ear expects I but hears the relative minor: G–Am.

Play I–IV–V–vi in C (C–F–G–Am) and hear the interrupted cadence; then play I–IV–V–I and hear the perfect cadence resolve.

1. Frequency of middle C

Middle C is key $n = 40$ (MIDI 60). $f = 440\times2^{(40-49)/12} = 440\times2^{-0.75} = 440\times0.594604 = 261.63$ Hz. Click C4 on the keyboard: the readout shows 261.63 Hz.

2. Which key is 1000 Hz?

Solve $1000 = 440\cdot2^{(n-49)/12}$: $n = 49 + 12\log_2(1000/440) = 49 + 12\times1.18442 = 63.21$. Nearest key $n = 63$ (B5, 987.77 Hz), which is $1200\log_2(1000/987.77) \approx 21$ cents flat of 1000 Hz.

3. Building E♭ major

  1. Start on E♭, apply W–W–H–W–W–W–H.
  2. E♭ → F (W) → G (W) → A♭ (H) → B♭ (W) → C (W) → D (W) → E♭ (H).
  3. Each letter is used once, so the flats are B♭, E♭, A♭: three flats, matching E♭ on the circle of fifths.
  4. Select E♭ + Major in the Scales panel to check.

4. Spelling and inverting a chord

A minor 7th on D: root D, minor 3rd F (3 semitones), perfect 5th A (7), minor 7th C (10): Dm7 = D–F–A–C. Its 3rd inversion puts C in the bass: C–D–F–A, written Dm7/C. Play C3 D3 F3 A3 and the chord detector names it.

5. Roman numerals: ii–V–I in B♭

B♭ major: B♭ C D E♭ F G A. ii = C minor, V = F major, I = B♭ major. With sevenths: Cm7 (C E♭ G B♭) → F7 (F A C E♭) → B♭maj7 (B♭ D F A). Notice the smooth voice leading: the 7th of each chord falls a step to the 3rd of the next (B♭→A, E♭→D).

6. Beats and tempo

At 90 BPM one beat lasts $60/90 = 0.667$ s. A bar of 4/4 lasts $2.67$ s, so a 12-bar blues takes $32$ s. Ode to Joy (16 bars of 4/4) at 120 BPM lasts $16\times4\times0.5 = 32$ s.

7. Beating between unison strings

Two strings tuned to A4 = 440 Hz and 441 Hz beat at $|f_1-f_2| = 1$ Hz: the sound swells once per second. A difference of 1.2 cents at 440 Hz is $440(2^{1.2/1200}-1) = 0.31$ Hz, the gentle shimmer used in this piano’s unison strings.

  1. Find the octaves. Play A2, A3, A4, A5 and read the frequency each time: 110, 220, 440, 880 Hz. Each octave doubles the frequency.
  2. Scale practice (auto-checked). In Scales, choose G major and press Practise, then play the scale upwards from any G. A toast confirms success; a wrong note restarts the attempt.
  3. Hear the modes. Play D Dorian and D natural minor back to back: they differ only in the 6th degree (B vs B♭). Then compare C Lydian (F♯) with C major.
  4. Inversions. Play C–E–G, then E–G–C, then G–C–E. The detector names all three “C major” and tells you the inversion.
  5. Circle walk. Click C, G, D, A on the circle and watch the key signature on the staff gain a sharp each time.
  6. Ear training challenge. Get a streak of 5 correct intervals at the Intermediate level (toast on success).
  7. Play-along challenge. Play Ode to Joy in wait mode with 90 % accuracy or better, then turn wait mode off and try at 100 % tempo.
  8. Record and listen. Start the metronome, record a I–IV–V–I progression in your own rhythm and play it back.
Have a USB or Bluetooth MIDI keyboard? Plug it in, press MIDI (Chrome and Edge support Web MIDI) and play: note velocity and the sustain pedal (CC64) are supported.

Computer keyboard

Two rows of your computer keyboard act as piano keys (positions shown for a QWERTY layout; any layout works by physical position):

Lower octave (starts on C3): Z C · S C♯ · X D · D D♯ · C E · V F · G F♯ · B G · H G♯ · N A · J A♯ · M B · , C …

Upper octave (starts on C4): Q C · 2 C♯ · W D · 3 D♯ · E E · R F · 5 F♯ · T G · 6 G♯ · Y A · 7 A♯ · U B · I C …

Space sustain pedal · ←/→ shift both rows by an octave. Tick PC keys to print the letters on the piano keys.

Mouse and touch

Click or tap keys; play chords with several fingers (multi-touch). Slide across the keys for a glissando. Striking a key nearer its front edge plays louder. Drag the mini-map above the keys to move along the 88-key keyboard, or choose how many octaves to show.