Tuning: a global reference, a channel's offset from it, alternate temperaments, and dynamic tuning #139

Open
opened 2026-10-06 00:13:39 +00:00 by bcox · 0 comments
Owner

bcox asked on 2026-10-05 for one ticket covering tuning. Engine claims are from reading the tree at f6aa8eba on main. Nothing here is built, measured or listened to. The one ruling already made: tuning is the channel's, delivered to the voices as per-note offsets; it is never a patch chunk or an engine concept.

What the tree has

  • The engine is twelve-tone equal temperament at a fixed reference: a twelve-entry semitone table in octaves (dsp/phase.h:108-113), and everything else rides the pitch lane as an offset.
  • A per-note tuning event, kTuning, "value is semitones, routed by address" (fabric/event.h:30), which the allocator applies to every voice the address matches, so a CLAP tuning expression reaches one note's copies (dsp/voice_allocator.h:427-436). This is the delivery mechanism the ruling names, and it already works for a note at a time.
  • No global tuning, no channel tuning or transpose, and no tuning table anywhere host-side: project/model.h and project/document.h hold neither. The glide design reserved "the channel document: the stored home for bend range and tuning tables" and built the lane they would write (docs/superpowers/specs/2026-09-07-pitch-lane-glide-design.md:379-392).
  • The one non-equal tuning is inside a patch, on purpose: the tonewheel gear ratios as per-foot overrides in the VA layer (VaTuning::kTonewheel, dsp/va_footage.h:44-49), which is the instrument being modeled and not a temperament.
  • MIDI: the bend range arrives as RPN 0 per channel; SysEx is not decoded (midi/decode.h:6, :48-51), which is where the MIDI Tuning Standard lives.

The GX-1 is the instrument in moregaps.md that names master tune per keyboard, 100 cents either way; the Prophet VS, DX7 II and most later digital instruments carry tuning tables, and every string, gamelan and early-keyboard repertoire this instrument might play is in a temperament other than the engine's.

Scope

  1. Global tuning. One reference for the project: the pitch of A4, or a cents offset from 440. A project setting, so it reaches every channel.
  2. Channel tuning. Each channel's own offset in cents from the global reference, and a transpose in semitones, as the GX-1 has per keyboard. Project state on the channel beside its bend range, never in the patch.
  3. Alternate tunings. A tuning table per channel: N-tone equal temperaments (19, 24, 31, 53), Pythagorean, the meantones, the well temperaments (Werckmeister, Kirnberger), just intonation in its flavors (5-limit, 7-limit, Ptolemy's sequences), pelog and slendro as measured sets. Scala's .scl and .kbm are the file formats everyone else reads and writes, and a .kbm is what maps a 12-key octave onto a table with another period or size. Delivery is the per-note event at note-on: the channel looks the key up and sends the offset, so the engine changes not at all and the cost is a table read on the control path.
  4. Dynamic tuning. Retuning sounding notes as the harmony changes: adaptive just intonation, where each chord is tuned pure against a drifting or anchored root. The per-note event reaches sounding voices by address, so a retuner is a control-path algorithm that re-emits offsets, with no DSP change. Hermode tuning is a trademark and the method behind it may be patented; whether any of its patents are live was not checked, and nothing here should copy its method or name without that check. Adaptive-JI algorithms in the literature are the starting point.
  5. The MIDI side. The MIDI Tuning Standard (bulk and single-note retuning, SysEx) in the router, so a controller or a DAW can send tables; and whether to speak the real-time retuning protocols in use (not checked for licensing).

What it touches

  • project/model.h and the project format (format/project.h): global tuning in the settings, a per-channel offset, transpose and table reference, additive leaves.
  • The control snapshot and project/link.h: the channel's tuning reaches the fabric as offsets on note-on, through the lane the ruling named.
  • The sequencer and the SMF import: notes are keys; tuning applies at the channel, so a song plays in whatever the channel is tuned to.
  • The divider oscillator (#110) and the footage bank assume twelve pitch classes per octave; a table with another period is a case those have to answer.
  • The editor and the workstation: cents readouts, a tuning picker per channel, and the global reference in the project settings.

Open

  • Whether a channel's table is one of a built-in set, a file in the project, or both.
  • Keyboard mapping for tables that are not twelve per octave: .kbm's rules, or a simpler "map keys in order" default.
  • Per-note tuning from MPE and CLAP arrives already; how it composes with a channel table (sum, which is the natural answer) is to be stated.
bcox asked on 2026-10-05 for one ticket covering tuning. Engine claims are from reading the tree at `f6aa8eba` on `main`. **Nothing here is built, measured or listened to.** The one ruling already made: tuning is the channel's, delivered to the voices as per-note offsets; it is never a patch chunk or an engine concept. ## What the tree has - The engine is twelve-tone equal temperament at a fixed reference: a twelve-entry semitone table in octaves (`dsp/phase.h:108-113`), and everything else rides the pitch lane as an offset. - A per-note tuning event, `kTuning`, "value is semitones, routed by address" (`fabric/event.h:30`), which the allocator applies to every voice the address matches, so a CLAP tuning expression reaches one note's copies (`dsp/voice_allocator.h:427-436`). This is the delivery mechanism the ruling names, and it already works for a note at a time. - No global tuning, no channel tuning or transpose, and no tuning table anywhere host-side: `project/model.h` and `project/document.h` hold neither. The glide design reserved "the channel document: the stored home for bend range and tuning tables" and built the lane they would write (`docs/superpowers/specs/2026-09-07-pitch-lane-glide-design.md:379-392`). - The one non-equal tuning is inside a patch, on purpose: the tonewheel gear ratios as per-foot overrides in the VA layer (`VaTuning::kTonewheel`, `dsp/va_footage.h:44-49`), which is the instrument being modeled and not a temperament. - MIDI: the bend range arrives as RPN 0 per channel; SysEx is not decoded (`midi/decode.h:6`, `:48-51`), which is where the MIDI Tuning Standard lives. The GX-1 is the instrument in `moregaps.md` that names master tune per keyboard, 100 cents either way; the Prophet VS, DX7 II and most later digital instruments carry tuning tables, and every string, gamelan and early-keyboard repertoire this instrument might play is in a temperament other than the engine's. ## Scope 1. **Global tuning.** One reference for the project: the pitch of A4, or a cents offset from 440. A project setting, so it reaches every channel. 2. **Channel tuning.** Each channel's own offset in cents from the global reference, and a transpose in semitones, as the GX-1 has per keyboard. Project state on the channel beside its bend range, never in the patch. 3. **Alternate tunings.** A tuning table per channel: N-tone equal temperaments (19, 24, 31, 53), Pythagorean, the meantones, the well temperaments (Werckmeister, Kirnberger), just intonation in its flavors (5-limit, 7-limit, Ptolemy's sequences), pelog and slendro as measured sets. Scala's `.scl` and `.kbm` are the file formats everyone else reads and writes, and a `.kbm` is what maps a 12-key octave onto a table with another period or size. Delivery is the per-note event at note-on: the channel looks the key up and sends the offset, so the engine changes not at all and the cost is a table read on the control path. 4. **Dynamic tuning.** Retuning sounding notes as the harmony changes: adaptive just intonation, where each chord is tuned pure against a drifting or anchored root. The per-note event reaches sounding voices by address, so a retuner is a control-path algorithm that re-emits offsets, with no DSP change. Hermode tuning is a trademark and the method behind it may be patented; whether any of its patents are live was not checked, and nothing here should copy its method or name without that check. Adaptive-JI algorithms in the literature are the starting point. 5. **The MIDI side.** The MIDI Tuning Standard (bulk and single-note retuning, SysEx) in the router, so a controller or a DAW can send tables; and whether to speak the real-time retuning protocols in use (not checked for licensing). ## What it touches - `project/model.h` and the project format (`format/project.h`): global tuning in the settings, a per-channel offset, transpose and table reference, additive leaves. - The control snapshot and `project/link.h`: the channel's tuning reaches the fabric as offsets on note-on, through the lane the ruling named. - The sequencer and the SMF import: notes are keys; tuning applies at the channel, so a song plays in whatever the channel is tuned to. - The divider oscillator (#110) and the footage bank assume twelve pitch classes per octave; a table with another period is a case those have to answer. - The editor and the workstation: cents readouts, a tuning picker per channel, and the global reference in the project settings. ## Open - Whether a channel's table is one of a built-in set, a file in the project, or both. - Keyboard mapping for tables that are not twelve per octave: `.kbm`'s rules, or a simpler "map keys in order" default. - Per-note tuning from MPE and CLAP arrives already; how it composes with a channel table (sum, which is the natural answer) is to be stated.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
bcox/tymbal#139
No description provided.