"""Tranquility Base: the harp's sixth piece, after a morning on the Moon (ISM Moon Base and the Apollo 11 diorama it time-travels you to, 2026-10-16). A major, 4/4 at quarter = 56, spacious. A: a melody that drifts down an octave, E5 to E4, like the lander settling. B: the "small step, giant leap" figure, a step up and then a leap of an octave, three times, climbing. Then the descent again, landing on a held A chord. Intro, A, B, A-home. ~2 min. Chords checked against the melody on paper. My own tune. Claude Opus 5.5 (Tessel). local/hear-venv/Scripts/python.exe life/making/harp/harp_piece6.py OUTDIR """ import sys from pathlib import Path HERE = Path(__file__).resolve().parent sys.path.insert(0, str(HERE)) sys.path.insert(0, str(HERE.parent / "music")) import synth as S from pieces import Song import harp_piece CH = {"A": "A2 E3 A3 C#4 E4 A4", "F#m7": "F#2 C#3 A3 C#4 E4 A4", "Dmaj9": "D2 A2 F#3 C#4 E4 A4", "E": "E2 B2 G#3 B3 E4 G#4", "C#m7": "C#2 G#2 E3 B3 E4 G#4", "Dmaj7": "D2 A2 F#3 A3 C#4 F#4", "Esus4": "E2 B2 A3 B3 E4 A4"} PROG = ["A", "F#m7", "Dmaj9", "E", "A", "C#m7", "Dmaj7", "Esus4"] INTRO = 2 SECTIONS = [("A", 2), ("B", 10), ("Aend", 18)] BARS = 28 # durations in eighths (bpb = 8); one bar per group A = ("E5:4 C#5:2 B4:2 A4:6 C#5:2 E5:4 F#5:2 E5:2 B4:8 " "C#5:4 B4:2 A4:2 G#4:6 B4:2 A4:4 F#4:2 E4:2 E4:8") B = ("E4:2 F#4:2 E5:4 C#5:4 A4:4 F#4:2 G#4:2 F#5:4 E5:4 B4:4 " "A4:2 B4:2 A5:4 G#5:4 E5:4 F#5:2 E5:2 C#5:4 B4:4 A4:4") AEND = A + " A4:8" def chord(bar): if bar < INTRO or bar >= BARS - 2: return "A" return PROG[(bar - INTRO) % 8] def piece(): s = Song("Tranquility Base", "A major", 112, bars=BARS, bpb=8, seed=1969, tail=5.0, tempo="4/4, quarter 56") s.cfg = {"harp": dict(gain=0, hp=55, hi=5600, send=0.55), "mel": dict(gain=2, hp=170, hi=7000, send=0.55), "sparkle": dict(gain=-12, hp=600, hi=8200, send=0.8)} s.reverb = {"rt60": 4.4, "wet": -6.5, "dark": 0.82} # a slow open arpeggio per bar, like breathing in a quiet cabin pattern = [(0, 0, 0.55), (2, 1, 0.33), (3, 2, 0.31), (4, 3, 0.29), (6, 4, 0.27), (7, 5, 0.21)] for bar in range(BARS - 1): notes = CH[chord(bar)].split() for beat, i, v in pattern: s.play("harp", S.pluck, bar, beat, notes[i], 8 if i == 0 else 4, v, pan=(i - 2.5) * 0.12, ring=5.0, bright=0.42) if 10 <= bar < 18 and bar % 2 == 0: # starlight over the leaps s.play("sparkle", S.pluck, bar, 6.5, notes[5], 2, 0.2, pan=0.35 if bar % 4 == 0 else -0.35, ring=3.4, bright=0.72) for name, bar in SECTIONS: ph = {"A": A, "B": B, "Aend": AEND}[name] s.line("mel", S.pluck, bar, ph, 0.56, pan=0.05, ring=4.0, bright=0.58) s.chord("harp", S.pluck, BARS - 1, 0, "A2 E3 A3 C#4 E4 B4 C#5 E5", 16, 0.48, spread=0.12, ring=6.5, bright=0.45) return s if __name__ == "__main__": harp_piece.piece = piece harp_piece.main(sys.argv[1])