Skip to content

Remove alteredDegrees from IntervalNetwork and AbstractScale - #2198

Open
float3 wants to merge 2 commits into
cuthbertLab:masterfrom
float3:pr/remove-altered-degrees
Open

float3 wants to merge 2 commits into
cuthbertLab:masterfrom
float3:pr/remove-altered-degrees

Conversation

@float3

@float3 float3 commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Closes #2185 (remove altered degrees in v11). Removes the alteredDegrees parameters from IntervalNetwork and ConcreteScale.findMissing, AbstractScale._alteredDegrees, processAlteredNodes, getUnalteredPitch and the AlteredDegree type, and the altered part of the realization cache keys. The migration guide lists the removal.

AI-assisted (Claude)

No scale in music21 sets altered degrees since HarmonicMinorScale builds
its raised seventh from its own intervals (A2, m2), and they have caused
several bugs: an alteration had to be undone before realizing, and the
realization cache had to be keyed on it.

Removed:
- the alteredDegrees parameter of every IntervalNetwork method and of
  ConcreteScale.findMissing
- AbstractScale._alteredDegrees
- IntervalNetwork.processAlteredNodes and getUnalteredPitch
- the AlteredDegree type and the altered part of the cache keys

The migration guide lists the removal.
@coveralls

coveralls commented Nov 2, 2026 •

Copy link
Copy Markdown

Coverage Status

coverage: 93.743%. remained the same — float3:pr/remove-altered-degrees into cuthbertLab:master

Give a suggestion on how the removed functionality could still be tracked.

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

Approved -- but one rename to consider -- and asking about a future PR of removing the specialized comparisons between .ps and instead just comparing Pitch to Pitch (in a later PR)

One pitch of an ascending walk and its node id.
'''
unalteredPitch: pitch.Pitch
realizedPitch: pitch.Pitch

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.

I wonder if this can just become .pitch now that it's the only kind of Pitch in a NetworkWalkStep

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.

Or maybe that will end up masking the import of pitch in a way that would just be too horrible. If so then walkPitch might be better?

walk = NetworkWalkPath([NetworkWalkStep(start, nodeObj.id)], nodeObj)
self._ascendingWalks[key] = walk
while not walk.ended and not _gte(walk.steps[-1].unalteredPitch.ps, maxPitch.ps):
while not walk.ended and not _gte(walk.steps[-1].realizedPitch.ps, maxPitch.ps):

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.

possibly .pitch as above. Someday we should consider why we're doing .ps comparisons here and not just Pitch1 >= Pitch2 according to the definition of pitch comparison in the rest of the system (is it for speed reasons?)

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.

Remove alteredDegrees from IntervalNetwork in v11?

3 participants