Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions music21/scale/intervalNetwork.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Authors: Christopher Ariza
# Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2010-2023 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2010-2026 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
'''
Expand Down Expand Up @@ -1739,16 +1739,16 @@ def realizeDescending(
while True:
appendPitch = False
if (minPitchObj is not None
and _gte(p.ps, minPitchObj.ps)
and _gte(pCollect.ps, minPitchObj.ps)
and maxPitchObj is not None
and _lte(p.ps, maxPitchObj.ps)):
and _lte(pCollect.ps, maxPitchObj.ps)):
appendPitch = True
elif (minPitchObj is not None
and _gte(p.ps, minPitchObj.ps)
and _gte(pCollect.ps, minPitchObj.ps)
and maxPitchObj is None):
appendPitch = True
elif (maxPitchObj is not None
and _lte(p.ps, maxPitchObj.ps)
and _lte(pCollect.ps, maxPitchObj.ps)
and minPitchObj is None):
appendPitch = True
elif minPitchObj is None and maxPitchObj is None:
Expand Down
11 changes: 10 additions & 1 deletion music21/scale/test_scale_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# Authors: Christopher Ariza
# Michael Scott Asato Cuthbert
#
# Copyright: Copyright © 2010-2024 Michael Scott Asato Cuthbert
# Copyright: Copyright © 2010-2026 Michael Scott Asato Cuthbert
# License: BSD, see license.txt
# ------------------------------------------------------------------------------
from __future__ import annotations
Expand Down Expand Up @@ -272,6 +272,15 @@ def testCyclicalScales(self):
sc2 = scale.CyclicalScale()
self.assertEqual(self.pitchOut(sc2.getPitches()), '[C4, D-4]')

def testHarmonicMinorDescendingRange(self):
sc = scale.HarmonicMinorScale('c4')
descending = sc.getPitches('b2', 'e3', direction=Direction.DESCENDING)
self.assertEqual(self.pitchOut(descending), '[E-3, D3, C3, B2]')

sc = scale.HarmonicMinorScale('b-3')
descending = sc.getPitches('c#4', 'g#4', direction=Direction.DESCENDING)
self.assertEqual(self.pitchOut(descending), '[G-4, F4, E-4, D-4]')

def testDeriveByDegree(self):
sc1 = scale.MajorScale()
self.assertEqual(str(sc1.deriveByDegree(7, 'G#')),
Expand Down
Loading