Skip to content

Check a descending range against the altered pitch (AI) - #2043

Merged
mscuthbert merged 1 commit into
cuthbertLab:masterfrom
float3:descending-range-altered-pitch
Sep 23, 2026
Merged

mscuthbert merged 1 commit into
cuthbertLab:masterfrom
float3:descending-range-altered-pitch

Conversation

@float3

@float3 float3 commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

realizeAscending decides whether a pitch is in range by the pitch it collects, alteration applied; realizeDescending decided by the pitch before alteration.

>>> sc = scale.HarmonicMinorScale('c4')
>>> sc.getPitches('b2', 'e3', direction=scale.Direction.DESCENDING)
[<music21.pitch.Pitch E-3>, <music21.pitch.Pitch D3>, <music21.pitch.Pitch C3>]
>>> sc = scale.HarmonicMinorScale('b-3')
>>> sc.getPitches('c#4', 'g#4', direction=scale.Direction.DESCENDING)[0]
<music21.pitch.Pitch A4>

Compare the collected pitch, as realizeAscending does.

realizeAscending decides whether a pitch is in range by the pitch it
collects, alteration applied; realizeDescending decided by the pitch
before alteration. So coming down, harmonic minor's raised seventh was
judged by the lowered one: left out where it belongs and let in where
it does not.

    >>> sc = scale.HarmonicMinorScale('c4')
    >>> sc.getPitches('b2', 'e3', direction=scale.Direction.DESCENDING)
    [<music21.pitch.Pitch E-3>, <music21.pitch.Pitch D3>, <music21.pitch.Pitch C3>]
    >>> sc = scale.HarmonicMinorScale('b-3')
    >>> sc.getPitches('c#4', 'g#4', direction=scale.Direction.DESCENDING)[0]
    <music21.pitch.Pitch A4>

Compare the collected pitch, as realizeAscending does.
@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 93.35% (+0.001%) from 93.349% — float3:descending-range-altered-pitch 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 for all this. Btw- alteredNodes was never a concept I fully bought into. I think that it will eventually be something to remove from the system, and just place the harmonic minor nodes accordingly.

@mscuthbert
mscuthbert merged commit 2ca6c06 into cuthbertLab:master Sep 23, 2026
8 checks passed
@float3
float3 deleted the descending-range-altered-pitch 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