Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(255)

Unified Diff: python/musicexp.py

Issue 305700043: Musicxml2ly: Fix incorrect conversion of Minor Chords
Patch Set: Created 7 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | scripts/musicxml2ly.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: python/musicexp.py
diff --git a/python/musicexp.py b/python/musicexp.py
index e8cbcb016769301209d51af8a4f8283537959b37..cee77054162db03d4214807d4300a4aabaa8dd02 100644
--- a/python/musicexp.py
+++ b/python/musicexp.py
@@ -1597,10 +1597,19 @@ class ChordNameEvent (Event):
value += self.duration.ly_expression ()
if self.kind:
value = self.kind.format(value)
+ # If there are modifications, we need a ":". This will not be
+ # the case for plain major chords.
+ if self.modifications and not ":" in value:
+ value += ":"
# First print all additions/changes, and only afterwards all subtractions
for m in self.modifications:
if m.type == 1:
- value += m.ly_expression ()
+ # Additions start with ".", but that requires a trailing
+ # digit. If none, omit the ".".
dak 2016/10/07 14:45:53 I think this behavior is wrong since the first dig
+ if re.search(r'\d$', value):
+ value += m.ly_expression ()
+ else:
+ value += m.ly_expression () [1:]
for m in self.modifications:
if m.type == -1:
value += m.ly_expression ()
« no previous file with comments | « no previous file | scripts/musicxml2ly.py » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b