Commit Graph

141 Commits

Author SHA1 Message Date
kennethreitz c006f5b3da Rewrite song.py with 7 playable songs and chord progressions
Melodies: Twinkle Twinkle, Ode to Joy, Happy Birthday, Fur Elise
Progressions: Pop I-V-vi-IV, 12-bar blues in A, Jazz ii-V-I turnaround
Interactive menu for picking songs. Clean helper functions for
melody and chord progression playback.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:28:31 -04:00
kennethreitz 9da3ac8b28 Add 12 example scripts showcasing pytheory features
- circle_of_fifths.py — visualize keys around the circle
- chord_identifier.py — identify chords from notes and fingerings
- key_explorer.py — explore keys, signatures, progressions, borrowed chords
- temperament_comparison.py — compare equal, Pythagorean, and meantone
- chord_tension.py — analyze tension, consonance, and voice leading
- world_scales.py — scales from 6 musical traditions
- fretboard_explorer.py — instruments, tunings, capo transposition
- midi_converter.py — MIDI ↔ note ↔ frequency reference
- progression_writer.py — famous progressions, Nashville numbers, random generation
- interval_trainer.py — interval names, songs, and consonance ranking
- overtone_series.py — harmonics and why chords sound good
- key_detection.py — detect keys from melodies and chord progressions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:27:18 -04:00
kennethreitz e94ef5dcfd Expand documentation with undocumented features and CLI guide
Tones: add from_frequency, from_midi, letter, midi, exists properties;
  interval naming with interval_to(); transpose(); MIDI section
Scales: add Key.signature, relative/parallel keys, borrowed chords,
  secondary dominants, random progressions, all_keys, scale transpose
Chords: add transpose, add_tone/remove_tone, root/quality properties;
  simplify identification examples with from_tones()
CLI: new guide covering all 8 commands (tone, scale, chord, key,
  fingering, progression, play, detect)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:11:01 -04:00
kennethreitz a5e47c37cd v0.6.0
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.6.0
2026-03-22 20:04:00 -04:00
kennethreitz 8a9651f989 Add tests for flat note name support
14 tests covering: flat tone creation, frequency matching with sharp
equivalents, all enharmonic pairs, arithmetic, intervals, exists
property, index resolution, chords built from flats, and
System.resolve_name().

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:02:26 -04:00
kennethreitz cc4a25e70d Support flat note names (Db, Bb, Eb, etc.) throughout the system
Flat names are now resolved to their canonical sharp equivalents when
looking up tones in a system. This means Tone.from_string("Db4") now
works for frequency, arithmetic, intervals, and chord building —
previously it raised a ValueError.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:01:11 -04:00
kennethreitz 904c61b2d6 Show enharmonic property in tones docs instead of from_tuple
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:59:30 -04:00
kennethreitz d23de92713 Update docs to use newer APIs (Key, Fingering, convenience constructors)
- Circle of fifths: use tone.circle_of_fifths() instead of manual loop
- Fingerings: show labeled Fingering class with string names, identify()
- Chords: document from_tones(), from_name(), from_intervals(), from_midi_message()
- Scales: add Key class, Key.detect(), Key.progression(), nashville()
- Playback: simplify examples with Chord.from_name()
- README: add Keys section, update fingering output format
- Quickstart: add chord identification from fret positions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 19:57:06 -04:00
kennethreitz e8bfeb884a Add Fingering class for labeled chord fingerings (#25)
Replace plain tuples from fingering() methods with a Fingering object
that labels each fret position with its string name, supporting both
named (f['A']) and index (f[1]) access while remaining backward
compatible with tuple equality.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 16:11:37 -04:00
kennethreitz 6aad427fb8 Fix 'pytheory play' chord name parsing for names containing digits
Chord names like Cmaj7 and G7 were incorrectly treated as tone names
because they contain digits. Now tries chord name lookup first. v0.5.1.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.5.1
2026-03-22 14:53:12 -04:00
kennethreitz e9c630705e Add 'pytheory play' CLI command for playing notes and chords
Supports single tones and chords, with --synth (sine/saw/triangle),
--duration, and --temperament flags. Bumps version to v0.5.0.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:47:20 -04:00
kennethreitz e78ba203d9 Add Symbolic Pitch section to tones docs
Dedicated section explaining symbolic=True with examples across
all three temperaments, showing exact SymPy expressions, arbitrary
precision evaluation, and why the math reveals temperament differences.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:40:20 -04:00
kennethreitz c307c1e41f v0.4.1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.4.1
2026-03-22 13:34:04 -04:00
kennethreitz b1f6996cd7 Add --temperament flag to CLI tone command
pytheory tone C5 -t pythagorean
pytheory tone A4 -t meantone

Shows frequency in chosen temperament and difference in cents
from equal temperament. Supports equal, pythagorean, meantone.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:08:24 -04:00
kennethreitz 51ca98779d Add CLI tool and Jupyter notebook tutorial
CLI (pytheory command):
  pytheory tone C4          — frequency, MIDI, overtones
  pytheory scale C major    — notes and intervals
  pytheory chord C E G      — identify, harmony, tension
  pytheory key C major      — full key analysis with diatonic chords
  pytheory fingering Am     — ASCII guitar tab
  pytheory progression C major I V vi IV — build from Roman numerals
  pytheory detect C D E G   — detect the key

Jupyter notebook (examples/tutorial.ipynb):
  46-cell interactive tutorial covering tones, scales, modes, keys,
  chord analysis, progressions, world music systems, guitar fingerings,
  and building a song from scratch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 13:05:33 -04:00
kennethreitz 37b41e1bbf Improve test coverage from 93% to 97% (476 tests)
Added 33 targeted tests covering:
- Tone: NotImplemented returns on comparison operators, negative
  frequency error, compound intervals, circle methods, octave
  parsing, enharmonic edge cases
- Chord: unidentified chord repr/str, __add__ NotImplemented,
  voice leading with different sizes, analyze with Tone key,
  diminished/augmented/9th analysis
- Scale: system object constructor, mode name degree lookup,
  KeyError on bad degree
- Key: string system param, flat key signatures, borrowed chords
  for minor, parallel/relative None returns
- Fretboard: fingering method returns Chord
- Charts: fix_fingering muted string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 12:53:06 -04:00
kennethreitz da40189845 v0.4.0: key signatures, scale diagrams, chord building, progression analysis
New features:
- Key.signature — sharps/flats count and accidental names
- Key.borrowed_chords — modal interchange from parallel key
- Key.random_progression(n) — weighted random diatonic progressions
- Chord.from_intervals("C", 4, 7) — build from root + semitones
- Chord.from_midi_message(60, 64, 67) — build from MIDI note numbers
- Chord.add_tone(tone) / remove_tone("B") — modify chords immutably
- Tone.letter — "C" from "C#" (letter without accidental)
- Fretboard.scale_diagram(scale) — ASCII neck diagram
- analyze_progression([chords], key="C") → ["I", "vi", "IV", "V"]

443 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.4.0
2026-03-22 12:48:04 -04:00
kennethreitz 54b82440c4 v0.3.2
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.3.2
2026-03-22 07:56:15 -04:00
kennethreitz ef003dbd1d Add type hints, docstrings, and property caching throughout
Type hints: all methods and properties across Tone, Scale, TonedScale,
Key, Chord, and Fretboard now have full type annotations using
from __future__ import annotations.

Docstrings: added to all methods that were missing them —
constructors, dunder methods, properties, classmethods.

Property caching:
- TonedScale._scales: computed once and cached (immutable after init)
- Chord.identify(): cached result, cleared on transpose/inversion
- Tone.frequency: cached after first computation

428 tests passing, no behavior changes.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:53:06 -04:00
kennethreitz 890c3cfbe2 v0.3.1
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.3.1
2026-03-22 07:47:08 -04:00
kennethreitz 599a00f066 Add capo, chord merging, tritone sub, secondary dominants, more progressions
Fretboard:
- Fretboard.guitar(capo=2) — capo as constructor parameter
- fretboard.capo(fret) — apply capo to any instrument

Chord:
- chord1 + chord2 — merge/layer two chords
- chord.tritone_sub() — jazz tritone substitution (transpose by 6)

Key:
- key.secondary_dominant(5) → V/V (e.g. D7 in C major)
- Key.all_keys() → all 24 major and minor keys

Progressions (14 total, up from 8):
- Pachelbel (Canon in D)
- Andalusian cadence (flamenco)
- Rhythm changes A section
- Jazz turnaround (iii-vi-ii-V)
- Dorian vamp, Mixolydian vamp

Also: py.typed marker for type checkers. 428 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:44:41 -04:00
kennethreitz 66b216cd08 Add Chord.from_tones, Scale.detect, Nashville numbers, ASCII tab
Chord.from_tones("C", "E", "G") — build chords from note name strings
Scale.detect("C", "D", "E", "F", "G", "A", "B") → ("C", "major", 7)
  Tries all tonics and scale types, returns best match.
Nashville number system:
  key.nashville(1, 4, 5, 1) — Arabic numeral alternative to Roman
  scale.nashville(1, "57") — supports 7th chord suffix
ASCII tab output:
  CHARTS["western"]["Am"].tab(fretboard=Fretboard.guitar())
  Renders fingerings as guitar tab with string names

415 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
v0.3.0
2026-03-22 07:38:02 -04:00
kennethreitz f6c110a995 Fix octave 0 bugs: full_name and pitch were wrong for A0, C0, etc.
- full_name used 'if self.octave' which is falsy for octave 0,
  so A0 displayed as "A" instead of "A0"
- pitch() used 'self.octave or 4' which defaulted octave 0 to 4,
  so A0 returned 440 Hz instead of 27.5 Hz

Both now use 'is not None' checks. 404 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:34:54 -04:00
kennethreitz 9da0434774 Add 12/8 time to Rhythm and Meter section
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:31:16 -04:00
kennethreitz 59f69079bf Fix pyproject.toml: move dependencies under [project], add build-system
Dependencies were at the root level instead of under [project] — uv
ignored them entirely. This caused uv.lock to omit pytuning, scipy,
numpy, and sounddevice. API reference pages were blank because
autodoc couldn't import the modules.

Also adds [build-system] so uv treats the project as editable
instead of virtual.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:26:28 -04:00
kennethreitz d8619f2e8f Fix docs CI: use uv sync --all-groups to install project + sphinx
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:23:09 -04:00
kennethreitz db04ab0796 Fix docs CI: install project deps before building with sphinx
uv sync --group docs only installs sphinx, not pytheory's deps
(pytuning, scipy, etc). Autodoc needs to import the package to
generate API reference pages. Now runs uv sync first.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:22:12 -04:00
kennethreitz 875f281633 Accept string system names in TonedScale and Key
TonedScale(tonic="Sa4", system="indian") now works — no need to
import SYSTEMS. Same for Key("C", "major", system="blues").

Updated README and all docs to use the cleaner string syntax,
removing 'from pytheory.systems import SYSTEMS' boilerplate.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:18:35 -04:00
kennethreitz c53584d733 Add key detection, tone properties, instrument listing
Key.detect("C", "E", "G") → <Key C major>
  Tries all major/minor keys, returns best match.
  Prefers major when tied with relative minor.

Tone properties:
  tone.is_natural → True for C, D, E, F, G, A, B
  tone.is_sharp   → True for C#, F#, etc.
  tone.is_flat    → True for Bb, Eb, etc.

Fretboard.INSTRUMENTS — list of all 25 preset names.

402 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:15:22 -04:00
kennethreitz 7153dc908f Add Chord.from_name, Interval constants, PROGRESSIONS, enharmonic, fix API docs
New features:
- Chord.from_name("Am7") — build chords from chart names
- Chord.__str__() — prints "C major" instead of raw tones
- Interval constants: Interval.PERFECT_FIFTH, MAJOR_THIRD, OCTAVE, etc.
- PROGRESSIONS dict: 8 common progressions as Roman numeral tuples
  ("I-V-vi-IV", "ii-V-I", "12-bar blues", etc.)
- Tone.enharmonic: C# → "Db", natural notes → None
- Key.__str__(): "C major"

Fix: docs CI now installs all dependencies (uv sync --group docs)
so autodoc can import pytheory modules. API reference pages were
blank on GitHub Pages because pytuning/scipy weren't installed.

New example: examples/explore.py — comprehensive demo of the full API.

393 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:09:16 -04:00
kennethreitz 240d2564a4 Remove logo from README
Removed logo image from README.
2026-03-22 07:03:41 -04:00
kennethreitz fd6ae888cf Add GitHub link and banner to docs sidebar
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:02:45 -04:00
kennethreitz c6e3f56136 Add Key class, Note alias, rewrite README
Key class — the friendliest entry point for music theory:
  Key("C", "major").chords → all diatonic triads
  Key("C", "major").seventh_chords → all diatonic 7th chords
  Key("C", "major").progression("I", "V", "vi", "IV")
  Key("C", "major").relative → Key("A", "minor")
  Key("C", "major").parallel → Key("C", "minor")

Note = Tone alias for discoverability.

README rewritten to showcase the full API:
  tones, scales, diatonic harmony, chord analysis,
  6 systems, 25 instruments, audio playback,
  comprehensive feature list.

381 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 07:00:22 -04:00
kennethreitz 5850ac00d5 Fix docs build warnings: malformed table and short underline
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:57:44 -04:00
kennethreitz 74ce7e39f8 Rewrite fretboard docs: all 25 instruments documented
Organized by family:
- Guitars: standard, 12-string, bass, alternate tunings
- Mandolin family: mandolin, mandola, octave mandolin, mandocello
- Bowed strings: violin, viola, cello, double bass, erhu
- Plucked: ukulele, banjo, harp
- World: oud, sitar, shamisen, pipa, bouzouki, lute, balalaika, charango
- Steel: pedal steel
- Keyboards: piano (88), synth (61), mini (25)

Each section includes tuning details, cultural context, and Wikipedia links.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:55:26 -04:00
kennethreitz d5beab46f2 Add Fretboard.keyboard() for piano/synth controllers
Fretboard.keyboard(keys=88, start="A0") — configurable key count:
- 88 keys = full piano (A0-C8)
- 61 keys = standard synth controller
- 49/37/25 keys = compact MIDI controllers

25 instrument presets total. 368 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:53:47 -04:00
kennethreitz 5e09e64c2d Add 9 world instruments: bouzouki, oud, sitar, shamisen, erhu, charango, pipa, balalaika, lute
World instruments:
- bouzouki (Irish GDAD / Greek CFAD)
- oud (Arabic, 6 courses, fretless)
- sitar (Indian, 7 main strings)
- shamisen (Japanese, 3 strings, honchoshi tuning)
- erhu (Chinese, 2 strings, bowed)
- charango (Andean, 5 courses, re-entrant)
- pipa (Chinese lute, 4 strings)
- balalaika (Russian, 3 strings, 2 in unison)
- lute (Renaissance, 6 courses)

24 instrument presets total. 365 tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:52:39 -04:00
kennethreitz 8bf716d1db Add full mandolin family, double bass, harp, pedal steel
Complete mandolin family (all tuned in fifths):
- mandolin     E5 A4 D4 G3 (= violin)
- mandola      A4 D4 G3 C3 (= viola, a 5th lower)
- octave_mandolin  E4 A3 D3 G2 (octave below mandolin)
- mandocello   A3 D3 G2 C2 (= cello)

New instruments:
- double_bass   G2 D2 A1 E1 (tuned in 4ths, unlike bowed strings)
- harp          47 strings, C1 to G7 (concert pedal harp)
- pedal_steel   10 strings, E9 Nashville tuning

15 instrument presets total. 355 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:50:02 -04:00
kennethreitz fcfba20ec5 Add mandolin, mandola, violin, viola, cello, banjo, 12-string presets
New Fretboard presets:
- Fretboard.mandolin()  — E5 A4 D4 G3 (tuned in 5ths)
- Fretboard.mandola()   — A4 D4 G3 C3 (octave below mandolin)
- Fretboard.violin()    — E5 A4 D4 G3 (same as mandolin)
- Fretboard.viola()     — A4 D4 G3 C3 (5th below violin)
- Fretboard.cello()     — A3 D3 G2 C2 (octave below viola)
- Fretboard.banjo(tuning) — open G, open D, double C
- Fretboard.twelve_string() — 12-string guitar (6 doubled courses)

Updated fretboard docs with string family section and custom
instrument examples (mandola, baritone ukulele, upright bass).

347 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:48:25 -04:00
kennethreitz 858f0c1c06 Add inversions, from_frequency, from_midi, harmonize, progressions
Tone:
- Tone.from_frequency(440) → <Tone A4> (nearest 12-TET note)
- Tone.from_midi(60) → <Tone C4> (MIDI note number conversion)

Chord:
- chord.inversion(1) → first inversion (root up an octave)
- chord.inversion(2) → second inversion
- Inversions preserve chord identity

Scale:
- scale.seventh(0) → Imaj7 seventh chord from scale degree
- scale.harmonize() → all diatonic triads
  ['C major', 'D minor', 'E minor', 'F major', 'G major', 'A minor', 'B diminished']
- scale.progression("I", "V", "vi", "IV") → chord progression from
  Roman numerals, with "7" suffix for seventh chords

339 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:45:19 -04:00
kennethreitz 4b9534eb9b v0.3.0: interval naming, MIDI, transpose, chord root/quality, clean API
New features:
- Tone.interval_to(other): "perfect 5th", "major 3rd", "octave"
- Tone.midi: MIDI note number (C4=60, A4=69)
- Tone.transpose(n): alias for tone arithmetic
- Chord.transpose(n): shift all tones, preserving quality
- Chord.root: identify the root tone
- Chord.quality: identify the chord quality ("major", "minor 7th")
- Scale.transpose(n): shift to a new key

Cleanup:
- __version__ = "0.3.0"
- __all__ defined — no more ceil/floor leaking
- pyproject.toml: author, license, classifiers, project URLs

319 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:42:31 -04:00
kennethreitz fdb724f788 Fix RST inline markup: remove bold wrapping around links
RST cannot nest inline markup — **`link <url>`_** renders the raw
markup instead of a clickable link. Removed all 37 instances across
5 guide pages.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:39:58 -04:00
kennethreitz 245a8a1257 Add Wikipedia links throughout docs, showcase dissonance API, update copyright
- Link key music theory terms to Wikipedia across all guide pages
- Physics of Consonance section now demos .harmony, .dissonance,
  .tension, and .beat_frequencies with code examples
- Copyright updated to 2026

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:35:40 -04:00
kennethreitz 4ab8be49a5 Add Music Theory Fundamentals page and deepen theory throughout docs
New: Music Theory Fundamentals guide covering:
- Sound and pitch (frequency ranges, logarithmic perception)
- Why twelve notes (harmonic series, Pythagorean comma)
- Intervals as atoms of music (size, quality, perfect vs major/minor)
- Keys and key signatures (sharp/flat key tables, FCGDAEB mnemonic)
- Functional harmony (tonic/subdominant/dominant, T-S-D-T)
- The dominant seventh (leading tone, tritone resolution)
- Rhythm and meter (4/4, 3/4, 6/8, odd meters)
- Physics of consonance (waveform alignment, cultural context)

Enriched existing pages:
- Tones: overtone series table, enharmonic equivalents and spelling rules
- Scales: 12-bar blues, parallel major/minor, borrowed chords,
  more progression examples with song references
- Chords: inversions (root/1st/2nd/3rd), extended chords (9ths/11ths/13ths)

Also: add Gauges analytics tracking to all pages

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:29:16 -04:00
kennethreitz 427a3fc3b1 Add Tone.circle_of_fifths() and Tone.circle_of_fourths()
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:26:15 -04:00
kennethreitz c3f9e98332 Add chord identification, voice leading, harmonic analysis, tension, overtones
New features:
- Chord.identify(): name any chord (17 patterns — triads, 7ths, 9ths, sus, power)
- Chord.voice_leading(other): find smoothest voice motion between chords
- Chord.analyze(key): Roman numeral analysis (I, ii, V7, etc.)
- Chord.tension: score with tritone count, dominant function detection
- Tone.overtones(n): harmonic series frequencies

Also:
- Rewrite README with all current features and docs link
- Add all new features to chords guide with music theory context
- Remove logo from docs sidebar
- 296 tests passing

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:25:31 -04:00
kennethreitz e1c2ef03d7 Comprehensive music theory documentation pass
Every guide page rewritten with deep music theory content:

- Tones: scientific pitch notation, frequency/pitch relationship,
  temperament history (equal/Pythagorean/meantone), interval table
  with song examples, circle of fifths
- Scales: interval pattern construction, major/minor/harmonic minor
  theory, all 7 modes with character descriptions and song references,
  scale degree names and functions, diatonic harmony and common
  chord progressions (I-IV-V, I-V-vi-IV, ii-V-I)
- Chords: triad and seventh chord construction tables, all 12 chord
  qualities with interval formulas, consonance/dissonance theory
  (Pythagoras to Plomp-Levelt), beat frequency perceptual ranges
- Fretboard: how frets work, string interval explanation, reading
  fingering notation, 8 alternate tunings with musical context,
  custom instrument examples (banjo, mandolin)
- Playback: waveform physics (harmonics, Fourier), temperament
  listening guide
- Quickstart: updated feature list (6 systems, 40+ scales, 144 chords)
- Fix duplicate logo/title in sidebar

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:20:01 -04:00
kennethreitz 21cd99425b Add Blues/Pentatonic and Javanese Gamelan systems
Blues: major/minor pentatonic, blues scale, major blues, dominant,
  minor (Dorian). The foundational scales of blues, rock, and jazz.

Gamelan: slendro (5-tone equidistant), pelog (7-tone with 3 pathet
  subsets: nem, barang, lima). 12-TET approximations of Javanese
  gamelan tuning with traditional tone names (ji, ro, lu, pat, mo,
  nem, pi/barang).

Total systems: 6 (western, indian, arabic, japanese, blues, gamelan)
277 tests passing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:15:11 -04:00
kennethreitz 69ddb1eb64 Rewrite chord analysis with musically accurate models
intervals: now returns semitone counts (integers) instead of Hz
  differences — octave-invariant and musically meaningful

harmony: frequency ratio simplicity model — reduces each pairwise
  frequency ratio to simplest form and scores by 1/(num+denom).
  Simple ratios (octave 2:1, fifth 3:2) score highest.

dissonance: Plomp-Levelt roughness with Bark-scale critical bandwidth
  (Zwicker & Terhardt 1980). Models sensory roughness from interfering
  fundamentals — peaks when freq difference ≈ critical bandwidth.

beat_frequencies: new property returning all pairwise beat frequencies
  as sorted (tone, tone, hz) tuples

beat_pulse: returns smallest non-zero beat frequency (most perceptible)

All properties have detailed docstrings with psychoacoustic references,
perceptual ranges, and usage examples.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:13:05 -04:00
kennethreitz 23c17589eb Simplify installation instructions in docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:07:57 -04:00