Skip to content

Mark an octave-repeating scale wider than an octave as not duplicating (AI) - #2045

Merged
mscuthbert merged 1 commit into
cuthbertLab:masterfrom
float3:octave-repeating-scale-wider-than-an-octave
Sep 23, 2026
Merged

mscuthbert merged 1 commit into
cuthbertLab:masterfrom
float3:octave-repeating-scale-wider-than-an-octave

Conversation

@float3

@float3 float3 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

AbstractOctaveRepeatingScale completes 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:

>>> scale.OctaveRepeatingScale('c4', ['P5', 'P5']).pitches
[<music21.pitch.Pitch C5>, <music21.pitch.Pitch G5>, <music21.pitch.Pitch D6>, <music21.pitch.Pitch C7>]

Now octaveDuplicating is set only when the completed pattern spans one octave, so the scale starts on C4.

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.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.349%. remained the same — float3:octave-repeating-scale-wider-than-an-octave into cuthbertLab:master

@mscuthbert mscuthbert left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

Comment thread music21/scale/__init__.py
@mscuthbert
mscuthbert merged commit 2fad5f9 into cuthbertLab:master Sep 23, 2026
8 checks passed
@float3
float3 deleted the octave-repeating-scale-wider-than-an-octave branch September 24, 2026 06:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants