Skip to content

v0.9.0: custom scales and Tune By Ear (#44, #30) - #59

Merged
Worldwave merged 11 commits into
mainfrom
issue44-scales
Oct 30, 2026
Merged

Worldwave merged 11 commits into
mainfrom
issue44-scales

Conversation

@Worldwave

Copy link
Copy Markdown
Owner

Closes #44. Closes #30.

What's in it

  • Custom scales from scales.cnfg. WAKES/CNFG/scales.cnfg holds 7 slots ([1]–[7]), each a Scala .scl block, so a scale exported from Scale Workshop pastes in as it is. Wakes' extras:
    • a weight after a pitch (0–255, default 255) for Marbles' STPS
    • plaits = N: Plaits' quantizer plays the degrees of weight ≥ N
    • tune_by_ear = on|off
  • The file is all or nothing, like engines.cnfg: any problem means the built-in scales, each one named in the log. Slots above [7] are dropped with an "overloaded" note, and the rest still loads. A missing file is written with the built-in text, like the other .cnfg files.
  • Built-in bank: Marbles' six scales written as Scala (12-TET in cents, pelog in Marbles' cents, the raags as just ratios, within 0.12 cent of Marbles' volts), plus whole-tone in slot 7.
  • [scales_wiki]: Wakes reads nothing below this line. The library below it is uncommented, each scale between copy markers: the seven modes, 31-EDO chromatic and 31-EDO Mothra[6]. The build checks that every example loads when pasted.
  • 64 degrees per scale (Marbles: 16). The quantizer is replaced in src/plaits_ovr/marbles/random/, and there is one quantizer per channel instead of six. Quantizing runs per clock tick, so this adds no audio CPU.
  • Plaits' quantizer is loaded with only its degrees and runs at level 1 (scale_level is gone). The note sets are unchanged.
  • OCTV's middle range (modes 1–8) is now one period either side of the root (was ±7 semitones), so both ends land on roots whatever the scale. The octave switch (mode 9) sweeps the scale's period.
  • Tune By Ear (FEATURE: Plaits Quantizer - Tune By Ear #30): turning the quantizer on takes FREQ's note as the scale's root (scales with tune_by_ear = on; pelog and the raags stay on C). Stepping between scales keeps the root.
  • PRST format 2: [plaits] quantizer_root. Format-1 presets still load in full, with the root on C. Presets keep remembering the scale SLOT.
  • New scales log category (off by default) logs the bank at every ON.
  • v0.9.0: firmware/VERSION, the issue templates and the manual for v0.9.0. The README's version line is left to Adara.

Checks

  • All 11 host suites pass. New coverage:
    • the scales reader and [scales_wiki]
    • the template read back equals the defaults
    • 64-EDO, 53-EDO and a tritave
    • OCTV in periods and Tune By Ear
    • PRST formats 1 and 2
  • Built locally as v0.9.0-rc1: wakes-sp1 537 516 B, fresh 542 416 B, fallback 86 992 B. 0 warnings, link at 0x20000, check_image passes.
  • Hardware: smoke-tested by Adara during development. The remaining test steps go to beta testers.

🤖 Generated with Claude Code

Worldwave and others added 11 commits October 16, 2026 15:44
The seven scale slots Marbles' X quantizer and Plaits' FREQUENCY quantizer
choose from now come from WAKES/CNFG/scales.cnfg, read at every ON like the
other config files. Each slot is a [1]-[7] section holding a Scala (.scl)
block, so a Scale Workshop export can be pasted as it is. Wakes adds a weight
after a pitch (Marbles' STEPS) and `plaits = N` per scale (Plaits plays the
degrees of weight >= N).

- config/scales.cnfg: Marbles' six presets written as Scala (12-TET in
  cents, pelog in Marbles' cents, the raags as just ratios: <= 0.12 cent
  from Marbles' 4-decimal tables). Slot 7 empty. tools/gen_scales.py builds
  the default bank and fails the build on a bad default.
- All or nothing like engines.cnfg; a slot above [7] is dropped with an
  "overloaded" note and the rest loads. A missing file is written back.
- sp1_scales.{c,h}: the bank, two copies, installed once per ON job before
  PRST; a generation count makes Marbles and Plaits reload their slot.
- Plaits' quantizer holds only its degrees (replaces scale_level); octave
  mode 9 sweeps the scale's own period.
- PRST unchanged: presets remember the scale slot (no format bump).
- logs.cnfg: new `scales` category, off by default.
- sp1_marbles_scales.inc removed; NOTICE, LICENSES and docs updated.
- cnfgtest section 7 covers the reader; all host suites pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scales.cnfg: Adara's prose edits, reviewed (the STEPS paragraph now says
  that turning STEPS up thins the scale out, as the quantizer does); note
  comments name the root they assume; a commented library of the seven
  diatonic modes, cut from the chromatic scale with Marbles' weighting
  (Ionian = Marbles' major note for note), to copy into a slot.
- Up to 64 pitches a scale (31-EDO, 53-EDO): Marbles' quantizer replaced in
  src/plaits_ovr (64 degrees, 64-bit masks), and one quantizer per output
  channel instead of six (generated overrides) -- Wakes only ever used
  slot 0. The quantizer runs per clock tick, so a long scale costs no CPU.
  The bank lives in .bss and serves the built-in scales until the first ON.
- OCTV modes 1-8: one period either side of the root (was +-7 semitones):
  the octave's C an octave down / up with no scale; with one, the scale's
  root nearest that C, one of its periods down / up.
- #30 Tune By Ear: turning Plaits' quantizer on takes the note FREQUENCY
  was playing as the scale's root; `tune_by_ear = on|off` per scale
  (default on; pelog and the ragas off). Presets load their scale on C.
- routetest section 13 and cnfgtest section 7 cover all of it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
PRST format 2 adds [plaits] quantizer_root: the root Tune By Ear took, in
semitones (MIDI numbering, 0..127, four decimals), saved and restored with
the scale. A bad value defaults that field only (root C).

Format 1 files still load in full, with the root on C, and the missing root
is not counted as a defaulted field. tools/gen_prst.py now records the
format each field was added in (SINCE) and treats an older format as
readable only while its fields still fingerprint to exactly what that format
recorded -- i.e. a change that only adds fields. It generates
SP1_PRST_READABLE from that, so a later change to an existing field makes
the older formats unreadable again on its own.

prsttest: the root round trip, its field check, format 1 with and without
the key, format 2 without it, format 3 rejected. routetest: a preset brings
its root back; a root of 0 loads on C.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…example

- config/scales.cnfg: Adara's edits -- slot [7] is a whole-tone scale (six
  equal steps, no weights, tune by ear on), a commented 31-EDO chromatic
  block to copy, and her prose. Typos fixed: "elimination", trailing
  spaces, a doubled lead-in ("Where that root sits:"), and the 31-EDO names
  of steps 12 and 17 ("Sub 4th" / "Sub 5th": perfect intervals take
  sub/super, not subminor).
- The default bank now fills all 7 slots. uitest: the ring tops out at
  slot 7, and skipping is checked with a bank that has a gap. prsttest:
  `free` (slot 7) loads from a preset with the default bank; its
  "empty slot is refused" checks run with slot 7 emptied. cnfgtest: seven
  built-in scales, whole-tone as written.
- docs/DEFAULTS.md and docs/MARBLES-SETTINGS.md: slot 7 is whole-tone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- scales.cnfg: the period line (2/1) takes no weight -- it is the root
  again one period up, so a weight there is ignored, and the root never
  drops out (Marbles' quantizer always needs one note left). Wording from
  Adara's suggestion.
- The 31-EDO chromatic example uses plaits = 0 (all 31 notes; it has no
  weights, so 32 changed nothing).
- New commented example at the end: 31-EDO Mothra[6] (generator 6 steps,
  232.26 cents; steps 6 6 6 6 6 1). Weights by generator count: 5th 192,
  supermajor 2nd 128, supermajor 6th 96, sub 4th 64, sub-octave 48; the
  other notes 8-24 as in the modes. plaits = 32 gives Plaits its six notes.
- The copy instructions now say "from the plaits line down to the 2/1
  line", which fits every block.
- cnfgtest: both 31-EDO blocks, uncommented as the file says, load; the
  chromatic gives 31 notes, Mothra[6] exactly steps 0 6 12 18 24 30.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…rkers

Copying an example out of scales.cnfg meant stripping "; " from every line
and guessing where the scale started under its description. Now:

- [scales_wiki] ends the scales. The device reader and tools/gen_scales.py
  read nothing below it: scales, keys, broken headers and long lines there
  are not problems. A [n] found below it is ignored with a note in the log
  ("move it above [scales_wiki]").
- The library (seven modes, 31-EDO chromatic, 31-EDO Mothra[6]) sits below
  it uncommented, each scale between a "copy from the line below" and a
  "copy down to the line above" marker; titles and descriptions stay
  outside the markers.
- The build parses every example between markers as a scale and fails,
  naming the line, if one would not load when pasted.
- cnfgtest copies the examples the way the file says (between markers) and
  checks the wiki is ignored, slots below it are notes, and problems above
  it still count.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
#44: custom scales from WAKES/CNFG/scales.cnfg (Scala blocks, up to 64
pitches, weights, plaits threshold, scale library under [scales_wiki]),
whole-tone in slot 7, OCTV modes 1-8 one period either side of the root,
#30 Tune By Ear with the root saved in presets (PRST format 2, format 1
still read).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Adara's updated manual: custom scales, Tune By Ear, the OCTV range.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
OCTV's octave switch and two-octave lock, Tune By Ear for most scales,
scales above slot 7 dropped, lowercase .logs, log written every 5 s.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Worldwave
Worldwave merged commit 8a37749 into main Oct 30, 2026
4 checks passed
@Worldwave
Worldwave deleted the issue44-scales branch October 30, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEATURE: Custom Scales FEATURE: Plaits Quantizer - Tune By Ear

1 participant