Commit Graph

32 Commits

Author SHA1 Message Date
kennethreitz b97378c836 Add Playing a Score section to playback docs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:04:29 -04:00
kennethreitz f00cf10c41 v0.13.0: Drum synthesizer with play_pattern() and play_score()
- 27 synthesized drum voices (kick, snare, hat, conga, timbale, etc.)
- play_pattern() renders and plays drum patterns through speakers
- play_score() mixes drum patterns + chord progressions together
- Comprehensive drum synthesis docs with sound descriptions

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 11:01:02 -04:00
kennethreitz d57e780f6f v0.12.0: Rhythm module with 48 drum pattern presets
- Duration, TimeSignature, Score for note-level rhythm
- DrumSound enum (27 GM percussion sounds)
- Pattern class with 48 presets: rock, jazz, bebop, salsa, bossa nova,
  samba, afrobeat, funk, reggae, house, trap, metal, Afro-Cuban claves,
  cumbia, merengue, breakbeat, and many more
- Pattern.to_score() + save_midi() for drum MIDI export
- Comprehensive rhythm guide documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 05:02:01 -04:00
kennethreitz 4f03bb6616 v0.12.0: Rhythm module with Duration, TimeSignature, Score, MIDI export
- Duration enum (whole through sixteenth, dotted, triplet)
- TimeSignature with string parsing (4/4, 3/4, 6/8, 12/8)
- Score class with fluent .add()/.rest() chaining
- Measure-aware MIDI export with time signature meta events
- Rhythm guide documentation

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 04:56:46 -04:00
kennethreitz 4aafd8d0b0 v0.11.0: Drop voicings, modulation, degree names, extensions, solfege, CLI identify/midi, docs
- Chord.close_voicing(), open_voicing(), drop2(), drop3()
- Key.modulation_path() for pivot-chord modulation paths
- Scale.degree_name() for traditional function names
- Chord.extensions() for available 9th/11th/13th suggestions
- Tone.solfege for fixed-Do solfege syllables
- CLI identify and midi commands
- Comprehensive docs update covering all v0.9.0–v0.11.0 features

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-25 04:49:17 -04:00
kennethreitz 09d90b3425 Use flat spellings in CHARTS acceptable_tone_names
NamedChord.acceptable_tones now uses prefer_flats based on circle-of-fifths
conventions. Cm7 shows (C, Eb, G, Bb) instead of (C, D#, G, A#).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:43:55 -04:00
kennethreitz d2058668a6 Use musically correct flat spellings in flat keys
Flat keys now display flats (Bb, Eb, Ab) instead of sharps (A#, D#, G#).
Uses the "no duplicate letter names" rule: if building a scale with
sharps produces two notes with the same letter (e.g. C and C# in C minor),
the scale is rebuilt with flat spellings instead.

- Tone.add() and Tone.from_index() accept prefer_flats parameter
- TonedScale detects flat vs sharp per-scale automatically
- F major: Bb (not A#), Eb major: Ab Bb (not G# A#), etc.
- All tests and docs updated to match

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:22:39 -04:00
kennethreitz a5ffdc6104 Expand cookbook, fix scale_diagram alignment, add play_progression
- 11 new cookbook recipes: circle of fifths, voice leading, tension
  analysis, tritone substitution, key signatures/detection, relative
  and parallel keys, borrowed chords, secondary dominants, overtones,
  enharmonics, world scales, guitar scale visualization
- Fix scale_diagram header alignment for 2-digit fret numbers
- play_progression() for sequencing chord playback

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 09:05:41 -04:00
kennethreitz 4750061b87 v0.8.0: Scale diagrams, cookbook, progression playback
- scale_diagram() showcased on homepage and quickstart
- New cookbook page: analyze a song, 12-bar blues, find chords in a key,
  compare scales, guitar chord chart, explore intervals
- play_progression() for sequencing chord playback with gaps
- Scale and Note aliases exported
- Version bump to 0.8.0

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:56:43 -04:00
kennethreitz b22b3c063f Improve fingering algorithm, add convenience APIs, convert all docs to REPL style
- Fretboard.chord(), .tab(), .chart() convenience methods
- Fingering.tab() for rendering ASCII tablature
- Fingering algorithm now considers muting, fret span, root-in-bass,
  and contiguous bass-side muting for idiomatic voicings
- All docs converted from code-block:: python to pycon with >>> prompts
- All doc outputs verified against actual library output
- Tests for new methods; version test no longer checks exact string

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:36:31 -04:00
kennethreitz 7e1d9e76bd v0.7.0: Add Fretboard.chord() method for named chord lookups
New `fb.chord("G")` API lets you look up fingerings by chord name
instead of knowing fret positions upfront. Updates all docs to use
REPL-style examples with verified output.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-23 08:12:42 -04:00
kennethreitz 7b82d70ad6 Document save() in playback guide and tritone_sub() in chords guide
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 21:20:35 -04:00
kennethreitz 44f8b902e2 Document capo support in fretboard guitars section
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 21:10:30 -04:00
kennethreitz eba299d406 Rewrite quickstart with sections for each feature area
Breaks the single code block into focused sections: Tones, Scales,
Keys and Chords, Guitar Fingerings, Audio Playback, and Command Line.
Adds installation notes for PortAudio, shows from_frequency/from_midi,
enharmonics, Key class, Chord convenience constructors, tab output,
WAV export, and CLI commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 20:59:55 -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 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 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 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 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 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 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 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 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 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
kennethreitz cceac40a88 Add Arabic and Japanese systems, guitar tuning presets, logo, systems docs
New systems:
- Arabic (Maqam): 10 maqamat (ajam, hijaz, nahawand, nikriz, saba, etc.)
  with Arabic solfège tone names (Do, Re, Mi, Fa, Sol, La, Si)
- Japanese: 6 pentatonic scales (hirajoshi, in, yo, iwato, kumoi, insen)
  and 2 heptatonic scales (ritsu, ryo)

Fretboard improvements:
- Fretboard.guitar() now accepts tuning parameter
- Built-in tunings: standard, drop d, open g, open d, open e, open a,
  dadgad, half step down
- Custom tuning via tuple: Fretboard.guitar(("E4", "B3", ...))
- Fretboard.bass(five_string=True) for 5-string bass

Docs:
- Add Musical Systems guide page with all 4 systems
- Add logo to docs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 06:06:17 -04:00
kennethreitz 4a77f9163e Add Sphinx documentation with alabaster theme
- User guide: quickstart, tones, scales, chords, fretboard, playback
- API reference: autodoc for all modules
- alabaster theme with Napoleon for Google/NumPy docstrings
- Update project description in pyproject.toml
- Add sphinx to docs dependency group

Build with: uv run --group docs sphinx-build -b html docs docs/_build/html

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 05:47:20 -04:00