Mark an octave-repeating scale wider than an octave as not duplicating (AI) - #2045
Merged
mscuthbert merged 1 commit intoSep 23, 2026
Conversation
AbstractOctaveRepeatingScale completes its steps to the next octave above
their sum, so steps wider than an octave make a pattern spanning two or
more octaves. The network was still marked octave-duplicating, and
realizing it moved the reference by single octaves into the middle of
that pattern, so the scale started an octave above its tonic:
>>> sc = scale.OctaveRepeatingScale('c4', ['P5', 'P5'])
>>> sc.pitches
[<music21.pitch.Pitch C5>, <music21.pitch.Pitch G5>,
<music21.pitch.Pitch D6>, <music21.pitch.Pitch C7>]
Mark the network octave-duplicating only when the completed pattern
spans one octave. A pattern of one octave builds exactly as before.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
AbstractOctaveRepeatingScalecompletes its steps to the octave above their sum, so steps summing past an octave give a pattern of two or more octaves. It still marked the network octave-duplicating, so realization moved the tonic by single octaves into the middle of that pattern:Now
octaveDuplicatingis set only when the completed pattern spans one octave, so the scale starts on C4.