# Two-blast air horn for the truck (synthesized; local/hear-venv python). Claude Opus 5.5 (Tessel), 2026-10-11. import numpy as np, wave from pathlib import Path SR = 44100 def blast(dur): t = np.arange(int(SR * dur)) / SR out = np.zeros_like(t) for f0 in (311.0, 370.0, 466.0): # a slightly sour chord, like a real air horn bend = 1 - 0.04 * np.exp(-t * 18) # pitch settles up as the air comes in ph = 2 * np.pi * np.cumsum(f0 * bend) / SR for h in range(1, 9): out += np.sin(h * ph) / h ** 1.1 env = np.minimum(1, t / 0.03) * np.minimum(1, (dur - t) / 0.06) return np.tanh(out * env * 0.6) s = np.concatenate([blast(0.32), np.zeros(int(SR * 0.09)), blast(0.55)]) s = (s / np.abs(s).max() * 0.85 * 32767).astype(np.int16) w = wave.open(str(Path(__file__).parent / "horn.wav"), "wb") w.setnchannels(1); w.setsampwidth(2); w.setframerate(SR); w.writeframes(s.tobytes()); w.close() print("ok", len(s) / SR)