Day 12 of ∞All days

Sunday, 15 November 2026

Raga Malkauns, a just-intonation reading

Malkauns, first expedition: a timbre where 4 of 4 steps land in consonance (an ordinary instrument: 1; Sethares' construction: 3).

The pentatonic midnight raga, without second or fifth, read in just intonation.

The numbers

An ordinary instrument
1 of 4 steps land
Sethares’ construction
3 of 4 steps land
Tonight’s search
4 of 4 steps land, a new record
The rule it found
Add alternating micro‑detuning of each partial to reduce intra‑tone roughness while keeping valley positions.
Programs tried
76 programs, 59 valid, across 12 generations
Also works for
Bhairav (6 of 6), Todi (5 of 6), Kafi (5 of 6)
The piece
Malkauns, Midnight Ratios

Tonight’s film

Read the program
const PARAMS = 4;
function timbre(target, p) {
	// 0: extra partials, 1: spectral tilt, 2: pull toward scale, 3: alternating detune strength
	const notes = [1, ...target.steps];
	const count = 6 + Math.round(p[0] * 8);          // total partials (incl. fundamental)
	const tilt = 0.4 + 1.6 * p[1];                  // amplitude roll‑off exponent
	const pull = p[2];                              // blend original harmonic ↔ nearest scale note
	const detune = p[3];                            // up/down micro‑detune (0‑1)

	const partials = [];
	for (let k = 1; k <= count; k++) {
		// locate nearest scale‑note multiple (including next period)
		const periods = Math.floor(Math.log(k) / Math.log(target.period));
		const base = Math.pow(target.period, periods);
		let best = base, bestDist = Infinity;
		for (const n of [...notes, target.period]) {
			const r = base * n;
			const d = Math.abs(Math.log(r / k));
			if (d < bestDist) { bestDist = d; best = r; }
		}
		// blend original harmonic (k) with the nearest scale‑aligned ratio (best)
		let ratio = Math.exp((1 - pull) * Math.log(k) + pull * Math.log(best));

		// apply a tiny alternating detune to soften intra‑tone beating
		const dir = (k & 1) ? 1 : -1;                     // +1 for odd, -1 for even partials
		const logShift = dir * detune * 0.005;            // ≈±8 cents at max detune
		ratio = Math.exp(Math.log(ratio) + logShift);

		if (ratio > 40) break;                           // stay inside allowed range
		partials.push({ ratio, amp: 1 / Math.pow(k, tilt) });
	}
	// ensure a decent fundamental level (already 1 × amp)
	return partials;
}

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.