home/ modules/ building-intervals-from-semitones

Building and Naming Intervals

  • learner can measure any interval in semitones and name it by quality and number
  • learner can invert an interval and classify perfect, major/minor, augmented/diminished and enharmonic cases
  • learner can distinguish concordant from discordant intervals by their frequency ratios

Given a set of note pairs, name every interval (quality + number), invert three of them and state each complement, flag one enharmonically-equal pair, and rank the set from most concordant to most discordant with a ratio-based justification.

Intervals are the currency of everything you will type into a live-coding buffer: when you write note "c4 e4" or transpose a pattern up seven semitones mid-set, you are manipulating intervals, and knowing instantly that +7 is a perfect fifth (stable, stackable) while +6 is a tritone (tension you must resolve or ride) is the difference between confident harmonic moves and trial-and-error on stage. This module builds one whole skill: take any pair of notes and fully account for it — measure it, name it, invert it, and judge how it will sound.

The arc starts supported. First anchor the raw measurement — an interval is a semitone distance that repeats at the octave — then layer the naming system on top: count letter classes inclusively for the number, then attach quality, using major/minor as simple big/small labels for seconds, thirds, sixths, and sevenths, and reserving perfect for fourths, fifths, and octaves. With naming fluent, extend to the edge cases: augmented and diminished widths, the tritone’s two spellings, and the fact that enharmonic intervals sound identical despite different names. Inversion then ties it together with two memorable invariants (numbers sum to 9, semitones to 12, quality flips). Finally, frequency ratios let you rank intervals from smooth concord to rough discord — including why thirds and sixths, though “imperfect,” blend so agreeably.

Every one of these ideas is exercised directly in the capstone: you cannot name, invert, flag the enharmonic pair, or justify a concordance ranking without them. The supporting atoms on the harmonic series and periodic tone versus noise deepen the “why” behind simple ratios sounding smooth, and are worth reading, but the capstone does not gate on them. Drill interval naming and inversion pairs until automatic — on stage there is no time to count.

Walkthrough

An interval is the distance between two pitches — the raw material of every melody and chord. You’ll hear them, not just count them: played melodically (one after another) and harmonically (together). At strudel.cc, Ctrl-Enter plays, Ctrl-. stops. Each step is a complete program; a [c3,e3] is two notes stacked into a chord.

1 — an interval is a semitone distance. From c3, count up: 2 semitones is a major 2nd (d3), 7 is a perfect 5th (g3). Play the two notes in turn, then together, and hear the gap. The number of semitones is the interval ([[interval-is-semitone-distance]], [[interval-letter-class-distance]]).

setcpm(90/4)
note("c3 g3 [c3,g3]").sound("sawtooth").lpf(1500)

2 — major vs minor: big and small. The same interval number comes in sizes. A major 3rd (c3e3, 4 semitones) sounds bright; a minor 3rd (c3eb3, 3 semitones) sounds dark. One semitone flips the whole mood ([[interval-naming]], [[major-minor-as-big-small]], [[imperfect-intervals-thirds-sixths]]).

setcpm(90/4)
note("[c3,e3] [c3,eb3]").sound("sawtooth").lpf(1500).gain(0.8)

3 — the perfect intervals. The unison, 4th (c3f3), 5th (c3g3), and octave (c3c4) are called perfect — they sound stable and hollow, the same in major and minor keys. The 5th and octave are the most consonant intervals there are ([[perfect-intervals]], [[octave-frequency-doubling]]).

setcpm(90/4)
note("[c3,f3] [c3,g3] [c3,c4]").sound("sawtooth").lpf(1600).gain(0.7)

4 — concord vs discord. Simple frequency ratios sound concordant (a 5th, 3:2); complex ones sound discordant and tense. Hear a smooth major 3rd, then a grinding minor 2nd (c3+db3), then the tritone (c3+f#3) — the most unstable interval, with two names (aug 4th / dim 5th) ([[concord-discord-intervals]], [[tritone-dual-name]], [[augmented-diminished-intervals]]).

setcpm(90/4)
note("[c3,e3] [c3,db3] [c3,f#3]").sound("sawtooth").lpf(1400).gain(0.7)

5 — inversion and its complement. Flip an interval (move the lower note up an octave) and it becomes its complement: a major 3rd inverts to a minor 6th, and the two numbers always sum to 9. Play c3e3, then e3c4, and hear the family resemblance ([[interval-inversion]], [[enharmonic-equivalents-sound-identical]]).

setcpm(90/4)
note("[c3,e3] [e3,c4]").sound("sawtooth").lpf(1500).gain(0.75)

6 — an interval study, concord → discord (the capstone). A short piece that walks from the most concordant to the most discordant, harmonically over a drone, then resolves home — the ranking made audible ([[concord-discord-intervals]]):

setcpm(90/4)
$: note("c2").sound("sawtooth").lpf(500).gain(0.5)
$: note("[c3,c4] [c3,g3] [c3,e3] [c3,a3] [c3,f#3] [c3,db3] [c3,c4]")
    .sound("sawtooth").lpf(1500).gain(0.6)

What good sounds like. You should be able to close your eyes and feel the stability: octave and 5th ring pure, thirds sound warm and coloured, seconds and the tritone bite. The beginner failure is naming intervals by counting letters alone and never internalising the sound — but on stage you choose intervals by ear. Sing the interval before you type it; the naming is bookkeeping for a sound you already know. (Skill map: live-coder Domain B3 — harmony for “non-musicians”: hear tension and resolution.)

Now make it yours. Play every interval from a different root. Arpeggiate each chord ([c3 e3] melodic instead of [c3,e3]). Build a bassline that moves by 5ths. Resolve the tritone outward to a 6th and inward to a 3rd, and hear both work. Stack three notes and you’ve made a chord — the next module.

Atoms in this module

Required — these gate the capstone

An interval is a musical distance measured in semitones, and it repeats every octave (12 semitones)
Concept L1 Foundations A
A musical interval's number name counts how many letter classes separate two notes
Concept L1 Foundations A
Interval names (second through octave) count scale steps inclusively from the lower to upper note
Procedure L1 Foundations A
Major and minor in interval names simply mean bigger and smaller versions of the same interval type
Concept L1 Foundations A
Fourths and fifths come in only one standard size called 'perfect', not major or minor
Concept L1 Foundations A
Thirds and sixths are imperfect intervals because they occur in both major and minor forms, yet their simple ratios make them pleasant sounding
Concept L1 Foundations A
Augmented intervals are one semitone wider than perfect/major; diminished intervals are one semitone narrower than perfect/minor
Concept L2 First instrument A
Inverting an interval by an octave produces its complement: numbers sum to 9, semitones to 12, and quality flips
Principle L2 First instrument A
Enharmonic intervals sound identical even though their spellings and names differ
Principle L2 First instrument A
Concordant intervals have simple frequency ratios and blend smoothly; discordant intervals have complex ratios and create tension
Concept L1 Foundations A
The tritone (6 semitones) is spelled augmented fourth or diminished fifth depending on context
Concept L1 Foundations A

Supporting — enrichment, not gating

A musical tone is a complex blend of harmonic partials whose ratios are whole-number multiples of the fundamental
Concept L1 Foundations AB
Musical tones have regular periodic waveforms; noise is aperiodic and chaotic
Concept L1 Foundations AB
A pitch class is one of the 12 chromatic notes named independently of octave
Fact L1 Foundations AF
Doubling a frequency raises the pitch by exactly one octave
Fact L1 Foundations AF
Octaves, 5ths, and 4ths are stable consonances; 2nds, 7ths, and tritones are tense dissonances that want to move
Concept L1 Foundations AF