From 460eaf682b8c9b5a3697944752c9598a924d7558 Mon Sep 17 00:00:00 2001 From: Michael Scott Asato Cuthbert Date: Fri, 9 Oct 2026 17:30:30 -1000 Subject: [PATCH] Fix caching problem / remove ref to defaultOctave Small PR --- music21/_version.py | 2 +- music21/base.py | 2 +- music21/defaults.py | 3 +++ music21/voiceLeading.py | 10 +++++++++- 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/music21/_version.py b/music21/_version.py index 9d2d4e79d..b78686896 100644 --- a/music21/_version.py +++ b/music21/_version.py @@ -47,7 +47,7 @@ ''' from __future__ import annotations -__version__ = '11.0.0b11' +__version__ = '11.0.0b12' def get_version_tuple(vv): v = vv.split('.') diff --git a/music21/base.py b/music21/base.py index b049c44f7..87c452e8e 100644 --- a/music21/base.py +++ b/music21/base.py @@ -26,7 +26,7 @@ >>> music21.VERSION_STR -'11.0.0b11' +'11.0.0b12' Alternatively, after doing a complete import, these classes are available under the module "base": diff --git a/music21/defaults.py b/music21/defaults.py index 95162b86a..99feeb555 100644 --- a/music21/defaults.py +++ b/music21/defaults.py @@ -39,6 +39,9 @@ # not allowing more can be construed as a feature. +# we used to have a defaultStep ('C') and defaultOctave (4) but +# no one ever changed them, and inlining makes so much faster. + partGroup = 'Part Group' partGroupAbbreviation = 'PG' diff --git a/music21/voiceLeading.py b/music21/voiceLeading.py index 9022376e8..ac983bb25 100644 --- a/music21/voiceLeading.py +++ b/music21/voiceLeading.py @@ -2216,7 +2216,7 @@ def couldBePassingTone(self) -> bool: >>> voiceLeading.ThreeNoteLinearSegment('B##3', 'C4', 'D--4').couldBePassingTone() False - If no octave is given then ._defaultOctave is used. This is generally octave 4. + If no octave is given then octave 4 is used: >>> voiceLeading.ThreeNoteLinearSegment('C', 'D', 'E').couldBePassingTone() True @@ -2225,6 +2225,14 @@ def couldBePassingTone(self) -> bool: >>> voiceLeading.ThreeNoteLinearSegment('C5', 'D', 'E').couldBePassingTone() False + But I wouldn't skip the octave, because otherwise this will always seem baffling: + + >>> voiceLeading.ThreeNoteLinearSegment('G', 'A', 'B').couldBePassingTone() + True + >>> voiceLeading.ThreeNoteLinearSegment('A', 'B', 'C').couldBePassingTone() + False + + Method returns True if either a chromatic passing tone or a diatonic passing tone is identified. Spelling of the pitch does matter!