# tuning defines how pitches are mapped to actual frequencies. supports tempered grids to ratio-based or freely defined arrays. ## introduction `tuning` belongs to the pitch layer and acts after `tonal`, `atonal`, or `generative` forms have produced a stream of pitch indices. its task is purely translational: given an integer or fractional index n, return a frequency f(n). no spectral shaping, modulation, or temperament drift occurs here; every output is deterministic and sample-accurate. ## overview each form translates a pitch index to frequency using a unique model: ### 0. `equal_division` behavior: divides an octave into q* equal steps; linear in cents analogy:* a well-tuned digital synth parameters:* * `a`: quantized divisions per octave (5 to 24) * `b`: global transpose from −600 to +600 cents ### 1. `just_intonation` behavior:* maps indices to low-integer ratios within a chosen prime-limit analogy:* a choir tuning pure fifths and thirds parameters:* * `a`: prime-limit morphing (3-limit to 11-limit) * `b`: root ratio (1/1 to 9/8) ### 2. `harmonic_series` behavior:* interprets index as harmonic number of a fundamental analogy:* touching a string at nodal points parameters:* * `a`: starting harmonic number (1 to 32) * `b`: stride (1 to 4) - selects every nth harmonic ### 3. `table_lookup` behavior:* fetches from a user-supplied list (1–128 entries), wraps linearly analogy:* twisting a radio dial across fixed stations parameters:* * `a`: fractional position into the table (wraps around) * `b`: per-note detune from −100 to +100 cents ## parameter behavior summary each form maps `a` and `b` to perceptually relevant controls: *equal\_division** * `a`: number of equal steps per octave (integer) * `b`: global detuning in cents *just\_intonation** * `a`: complexity of allowed ratios (lower primes to higher) * `b`: selects base ratio within the harmonic series *harmonic\_series** * `a`: first harmonic number used as index base * `b`: harmonic spacing step (stride) *table\_lookup** * `a`: fractional index into user-provided table * `b`: local detuning in cents ## why these were chosen minimal and complete coverage:* the selected forms span the full space of tuning logic: * equal temperament families * rational tuning systems * spectral/harmonic frameworks * arbitrary or culturally specific scales orthogonality:* no form can express the function of another without external data or parameters. parametric clarity:* each form uses exactly two parameters to traverse a useful and distinct perceptual space. deterministic sound structure:* all tunings yield exact, precomputed frequencies-compatible with the system's goals. ## what is not included historical temperaments (e.g., meantone, well):* can be approximated via `equaldivision` or encoded in `tablelookup`. dynamic or adaptive tunings:* require context-sensitive logic, which is outside this system's design scope. continuous glissandi or curves:* considered upstream, at the pitch-generation level, not within tuning translation. ## conclusion these four forms give the system a complete and flexible pitch-to-frequency translation layer. they honor the commitment to irreducibility, determinism, and two-parameter expressivity while leaving space for future inclusion of non-octave or non-logarithmic tunings under the same structural principles.