diff --git a/CHANGELOG.md b/CHANGELOG.md index 8cb6778..8369565 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,10 @@ All notable changes to PyTheory are documented here. +## 0.41.1 + +- **Fix** — `to_abc()` no longer crashes on parts containing drum tones. + ## 0.41.0 - **ABC notation export** — `Score.to_abc()` converts scores to ABC notation diff --git a/pyproject.toml b/pyproject.toml index c9e1e63..e935245 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pytheory" -version = "0.41.0" +version = "0.41.1" description = "Music Theory for Humans" readme = "README.md" license = "MIT" diff --git a/pytheory/__init__.py b/pytheory/__init__.py index c7bbae6..90e4dfa 100644 --- a/pytheory/__init__.py +++ b/pytheory/__init__.py @@ -1,6 +1,6 @@ """PyTheory: Music Theory for Humans.""" -__version__ = "0.41.0" +__version__ = "0.41.1" from .tones import Tone, Interval from .systems import System, SYSTEMS, TET diff --git a/pytheory/rhythm.py b/pytheory/rhythm.py index 646b6ed..bd1be5a 100644 --- a/pytheory/rhythm.py +++ b/pytheory/rhythm.py @@ -4442,6 +4442,10 @@ class Score: if tone is None: return "z" + # Skip drum tones — they don't have pitched names + if not hasattr(tone, "name") or not hasattr(tone, "octave"): + return "z" + name = tone.name # e.g. "C", "C#", "Bb" octave = tone.octave if tone.octave is not None else 4 diff --git a/uv.lock b/uv.lock index 78d3162..cf0a3a5 100644 --- a/uv.lock +++ b/uv.lock @@ -690,7 +690,7 @@ wheels = [ [[package]] name = "pytheory" -version = "0.41.0" +version = "0.41.1" source = { editable = "." } dependencies = [ { name = "rich" },