Skip to content
Merged
Show file tree
Hide file tree
Changes from 40 commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
dc812a4
First attempt at adding accidentals to Turns, Trills, and Mordents.
gregchapman-dev Mar 22, 2023
582a367
Add the ability to set size for Mordent/Trill, but only if the Morden…
gregchapman-dev Mar 22, 2023
90f38cf
Fix interval calculation.
gregchapman-dev Mar 22, 2023
ea8d3e8
Fix some bugs to get tests passing.
gregchapman-dev Mar 22, 2023
5114ede
Enhance Trill/Mordent/Turn name to include any accidental(s).
gregchapman-dev Mar 23, 2023
2e92bfb
Mordent/Turn/Trill.get{Upper,Lower,}Size now takes pitch instead of n…
gregchapman-dev Mar 24, 2023
57b5f01
Write ornament accidentals as <accidental-mark> in m21ToXml.py.
gregchapman-dev Mar 25, 2023
52a3280
Get rid of accidental-mark TODOs. They're done.
gregchapman-dev Mar 25, 2023
6f75a9b
Be a little more accurate about what has been done with accidental-mark.
gregchapman-dev Mar 25, 2023
835910c
Fix notations32a.xml "turn+acc.(ab.+bel./rel to turn)", which had bot…
gregchapman-dev Mar 25, 2023
1c88d57
Fix some tests.
gregchapman-dev Mar 25, 2023
f558b8e
Allow accid to be set (not just __init__ed), but only if size has not…
gregchapman-dev Mar 26, 2023
0def6e3
Make the turn accidentals in notation32a be ones that Finale can actu…
gregchapman-dev Mar 26, 2023
b83121b
Parse 'accidental-mark' (Ornament) from MusicXML.
gregchapman-dev Mar 26, 2023
88333d5
Test turn accidentals (upper and lower).
gregchapman-dev Mar 26, 2023
256d013
mypy notes that I was setting accid on ornaments that didn't have 'em.
gregchapman-dev Mar 26, 2023
a16c2d5
Redo ornament accidentals to use accidental names, and then resolveOt…
gregchapman-dev Mar 28, 2023
e76f405
Oops, missed one.
gregchapman-dev Mar 28, 2023
f519b9d
Modify makeAccidentals to deal with ornament accidentals.
gregchapman-dev Mar 28, 2023
333721f
Fix a crash in Stream.pitches when a GeneralNote has no pitches (e.g.…
gregchapman-dev Mar 28, 2023
f00e741
First swath of review response.
gregchapman-dev Mar 30, 2023
f738377
Remove Trill/GeneralMordent/Turn size property. Clients now have to …
gregchapman-dev Mar 30, 2023
1d87d2d
Oops, fix that test.
gregchapman-dev Mar 30, 2023
59e02d5
Placate flake8.
gregchapman-dev Mar 30, 2023
3283c3f
Refine headerdoc a bit. Put three-quarters-flat back as accidental b…
gregchapman-dev Mar 30, 2023
4cae3c2
Even more headerdoc/tests.
gregchapman-dev Mar 30, 2023
53263a5
A few style tweaks and a bunch of headerdoc.
gregchapman-dev Mar 31, 2023
e90ae4f
Turns out you really need an explit octave before you transpose, or y…
gregchapman-dev Mar 31, 2023
053d933
Implement InvertedTrill, simplify InvertedTurn, fix TrillRecognizer t…
gregchapman-dev Mar 31, 2023
3414cc2
Oops typo.
gregchapman-dev Mar 31, 2023
7851f48
I missed some implicit octave transposes.
gregchapman-dev Apr 1, 2023
0150cc4
Add some more tests.
gregchapman-dev Apr 1, 2023
7997ce6
Fix a couple tests.
gregchapman-dev Apr 1, 2023
b9a1494
Implement Trill/Mordent/Turn on Unpitched. More tests/fixes.
gregchapman-dev Apr 1, 2023
cf27d2b
Test some edge conditions.
gregchapman-dev Apr 2, 2023
b0ab490
Add tests for Trill/GeneralMordent/Turn.updateAccidentalDisplay.
gregchapman-dev Apr 2, 2023
08fd681
When setting pitch.accidental to a float, do your best to put the qua…
gregchapman-dev Apr 2, 2023
edfba3b
Be consistent about _direction typing.
gregchapman-dev Apr 2, 2023
bcc3808
Test and fix ornament <accidental-mark> parse and write.
gregchapman-dev Apr 2, 2023
a9de789
Fix pitch.py test expectations to match new quarter-tone preference o…
gregchapman-dev Apr 2, 2023
8ed3beb
Do the "microtones to quarter tones" operation in Ornament et al, ins…
gregchapman-dev Apr 8, 2023
3308ee4
Remove "microtones to quarter tones" operation from pitch.accidental …
gregchapman-dev Apr 8, 2023
19c91f4
Address a few review comments.
gregchapman-dev Apr 8, 2023
b23eba0
Undo my workaround for issue #1553 (transpose can lose microtones), a…
gregchapman-dev Apr 9, 2023
c7965bf
And test that fix.
gregchapman-dev Apr 9, 2023
367e9ab
A little more testing.
gregchapman-dev Apr 10, 2023
77af85e
{Trill,GeneralMordent}.accidentName -> accidental (with displayStatus…
gregchapman-dev Apr 15, 2023
40f89f7
Improvements to the documentation.
gregchapman-dev Apr 17, 2023
4d321cf
More review response.
gregchapman-dev Apr 18, 2023
a401969
Fix a typo, make mypy happier.
gregchapman-dev Apr 18, 2023
d82183f
Fix test to not use back-tick for half-flat.
gregchapman-dev Apr 18, 2023
6c3da7c
Move two new routines from stream/base.py to stream/makeNotation.py.
gregchapman-dev Apr 18, 2023
9678517
Add documentation for makeOrnamentalAccidentals.
gregchapman-dev Apr 18, 2023
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
2 changes: 1 addition & 1 deletion music21/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
'''
from __future__ import annotations

__version__ = '9.0.0a9'
__version__ = '9.0.0a11'


def get_version_tuple(vv):
Expand Down
43 changes: 33 additions & 10 deletions music21/alpha/analysis/ornamentRecognizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,14 +131,19 @@ def recognize(self, busyNotes, simpleNotes=None) -> bool | expressions.Trill:
else:
return False

# set up trill
trill = expressions.Trill()
trill.quarterLength = self.calculateOrnamentNoteQl(busyNotes, simpleNotes)
if isNachschlag:
trill.nachschlag = True

if not simpleNotes:
trill.size = interval.Interval(noteStart=n1, noteEnd=n2)
# set up trill (goes up) or inverted trill (goes down)
if n1.pitch.midi <= n2.pitch.midi:
trill = expressions.Trill()
else:
trill = expressions.InvertedTrill()
trill.quarterLength = self.calculateOrnamentNoteQl(busyNotes, simpleNotes)
if isNachschlag:
trill.nachschlag = True

if n2.pitch.accidental is not None:
trill.accidentalName = n2.pitch.accidental.name
trill.resolveOrnamentalPitches(n1)
return trill

# currently ignore other notes in simpleNotes
Expand All @@ -153,8 +158,19 @@ def recognize(self, busyNotes, simpleNotes=None) -> bool | expressions.Trill:
if simpleNote.pitch.midi == n2.pitch.midi:
endNote = n1
startNote = n2
distance = interval.Interval(noteStart=startNote, noteEnd=endNote)
trill.size = distance

# set up trill (goes up) or inverted trill (goes down)
if startNote.pitch.midi <= endNote.pitch.midi:
trill = expressions.Trill()
else:
trill = expressions.InvertedTrill()
trill.quarterLength = self.calculateOrnamentNoteQl(busyNotes, simpleNotes)
if isNachschlag:
trill.nachschlag = True

if endNote.pitch.accidental is not None:
trill.accidentalName = endNote.pitch.accidental.name
trill.resolveOrnamentalPitches(startNote)
return trill

class TurnRecognizer(OrnamentRecognizer):
Expand Down Expand Up @@ -619,7 +635,14 @@ def testRecognizeTrill(self):
# ensure trill is correct
self.assertEqual(trill.nachschlag, cond.isNachschlag, cond.name)
if cond.ornamentSize:
self.assertEqual(trill.size, cond.ornamentSize, cond.name)
if cond.simpleNotes:
if cond.simpleNotes[0].pitch.midi == cond.busyNotes[1].pitch.midi:
size = trill.getSize(cond.busyNotes[1])
else:
size = trill.getSize(cond.busyNotes[0])
else:
size = trill.getSize(cond.busyNotes[0])
self.assertEqual(size, cond.ornamentSize, cond.name)
else:
self.assertFalse(trill, cond.name)

Expand Down
2 changes: 1 addition & 1 deletion music21/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
<class 'music21.base.Music21Object'>

>>> music21.VERSION_STR
'9.0.0a9'
'9.0.0a11'

Alternatively, after doing a complete import, these classes are available
under the module "base":
Expand Down
Loading