Day 2 of ∞All days

Thursday, 5 November 2026

The harmonic series from the 8th to the 16th partial

Harmonics 8–16, first expedition: a timbre where 3 of 7 steps land in consonance (an ordinary instrument: 1; Sethares' construction: 1).

Nature's own scale: eight steps of the harmonic series, including 11 and 13.

The numbers

An ordinary instrument
1 of 7 steps land
Sethares’ construction
1 of 7 steps land
Tonight’s search
3 of 7 steps land, a new record
The rule it found
Selective reinforcement – add low‑amplitude exact scale‑step partials and attenuate the induced partials, deepening valleys without increasing roughness
Programs tried
76 programs, 55 valid, across 12 generations
The piece
Harmonic Bloom — Day 2 of ∞

Tonight’s film

Read the program
const PARAMS = 3; // [tilt, reinforce, periods]

function timbre(target, p) {
  // knobs in [0,1]
  const tilt = 0.3 + 1.7 * Math.min(1, Math.max(0, p[0]));          // exponent 0.3‑2.0
  const reinforce = Math.min(1, Math.max(0, p[1]));                // weight of exact‑scale partials
  const periods = 1 + Math.round(Math.min(1, Math.max(0, p[2])) * 2); // 1‑3 periods

  const notes = [1, ...target.steps];               // scale degrees within one period
  const maxRatio = 40;
  const maxHarm = 16;                               // enough for the 8‑16 series
  const period = target.period;                    // e.g. 2 (octave)

  // ----- all exact scale ratios across the chosen number of periods -----
  const scaleRatios = [];
  for (let o = 0; o <= periods; o++) {
    const base = Math.pow(period, o);
    for (const n of notes) {
      const r = base * n;
      if (r <= maxRatio) scaleRatios.push(r);
    }
  }

  // ----- induced spectrum (move each harmonic to nearest scale ratio) -----
  const partials = [{ ratio: 1, amp: 1 }]; // fundamental, loudest

  for (let k = 2; k <= maxHarm; k++) {
    let bestR = k;
    let bestDist = Infinity;
    for (const r of scaleRatios) {
      const d = Math.abs(Math.log(r / k));
      if (d < bestDist) {
        bestDist = d;
        bestR = r;
      }
    }
    // attenuate induced partials by (1‑reinforce)
    const amp = (1 - reinforce) * Math.pow(1 / k, tilt);
    partials.push({ ratio: bestR, amp });
  }

  // ----- exact‑scale reinforcement partials (low amplitude) -----
  for (const r of scaleRatios) {
    if (r === 1) continue; // skip duplicate fundamental
    const amp = reinforce * Math.pow(1 / r, tilt);
    partials.push({ ratio: r, amp });
  }

  // ----- keep strongest 32, guarantee fundamental present -----
  partials.sort((a, b) => b.amp - a.amp);
  const result = partials.slice(0, 32);
  if (!result.some(p => p.ratio === 1)) {
    // replace the quietest slot with the fundamental if it got dropped
    result[31] = { ratio: 1, amp: 1 };
  }

  // ----- ensure fundamental ≥20 % of loudest partial -----
  const maxAmp = Math.max(...result.map(p => p.amp));
  const fund = result.find(p => p.ratio === 1);
  if (fund && fund.amp < 0.2 * maxAmp) fund.amp = 0.2 * maxAmp;

  return result;
}

Consonance here is measured with Sethares’ model of sensory dissonance, not by ear. A step lands when it sits at the bottom of a valley in the timbre’s dissonance curve. Perfect harmony is out of reach — pure fifths and thirds never close into one scale — which is why the search does not end.

Every morning, what the night found.

One email a day at 7am Singapore time, with the discovery, the music and the film.