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
1 change: 1 addition & 0 deletions music21/pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -5145,6 +5145,7 @@ def set_displayStatus(newDisplayStatus: bool) -> None:
# and it is not a natural, it should always be set to display
if (pPastInMeasure is False
and acc is not None
and acc.name != 'natural'

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

See "not a natural" in the above 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.

wow. it literally says that!

and not self._nameInKeySignature(alteredPitches)):
acc.displayStatus = True
return # do not search past
Expand Down
12 changes: 12 additions & 0 deletions music21/test/test_pitch.py
Original file line number Diff line number Diff line change
Expand Up @@ -407,6 +407,18 @@ def testImplicitToExplicitNatural(self):
p.makeAccidentals(inPlace=True)
self.assertIs(last_note.pitch.accidental.displayStatus, False)

def testExplicitNaturalDisplayStatusNone(self):
p = converter.parse('tinyNotation: d1 d1')
first_note = p.recurse().notes.first()
last_note = p.recurse().notes.last()
first_note.pitch.accidental = pitch.Accidental('natural')
last_note.pitch.accidental = pitch.Accidental('natural')
self.assertIsNone(first_note.pitch.accidental.displayStatus)
self.assertIsNone(last_note.pitch.accidental.displayStatus)
p.makeAccidentals(inPlace=True)
self.assertIs(first_note.pitch.accidental.displayStatus, False)
self.assertIs(last_note.pitch.accidental.displayStatus, False)

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Only this last assertion failed before.


def testIfAbsolutelyNecessary(self):
'''
Beginning of test cases for if-absolutely-necessary.
Expand Down
Loading