"""Render lintunes/sounds/tink.wav — the quiet "done" chime. A bell-ish 1.6 kHz partial with a softer inharmonic overtone, a 3 ms attack (no click) and a fast exponential decay. Run once; the WAV is committed. python3 scripts/make_tink.py """ import wave from pathlib import Path import numpy as np RATE = 44100 LENGTH = 0.35 # seconds; the decay is inaudible well before this PEAK_DBFS = -18.0 def render() -> np.ndarray: t = np.arange(int(RATE * LENGTH)) / RATE tone = (np.sin(2 * np.pi * 1600 * t) + 0.35 * np.sin(2 * np.pi * 1600 * 2.76 * t) * np.exp(-t * 40)) envelope = np.exp(-t * 18) * np.minimum(t / 0.003, 1.0) signal = tone * envelope signal /= np.abs(signal).max() return signal * 10 ** (PEAK_DBFS / 20) def main(): out = Path(__file__).resolve().parent.parent / "lintunes" / "sounds" / "tink.wav" out.parent.mkdir(parents=True, exist_ok=True) pcm = (render() * 32767).astype("