[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 b
From: |
pkx166h |
Subject: |
Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by address@hidden) |
Date: |
Fri, 07 Oct 2016 07:12:47 -0700 |
Reviewers: ,
Message:
Patch on countdown for October 11th
Description:
Musicxml2ly: Fix incorrect conversion of Minor Chords
Issue 4980
The solutions for the invalid combinations
are provided in python/musicexp.py. A colon
is added if a colon-less chord (i.e., major)
has modifications. Adding additions checks
for a trailing digit, if none, the leading
period is omitted.
Note that the changes in python/musicexp.py
are harmless to an un-patched scripts/musicxml2ly.
Please review this at https://codereview.appspot.com/305700043/
Affected files (+16, -7 lines):
M python/musicexp.py
M scripts/musicxml2ly.py
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 ".".
+ 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 ()
Index: scripts/musicxml2ly.py
diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py
index
766214bd762b5dc8e991849d70a91473f4bbb782..f2874fea5b6201778624b990cb0ad612021163f4
100644
--- a/scripts/musicxml2ly.py
+++ b/scripts/musicxml2ly.py
@@ -1601,10 +1601,10 @@ def musicxml_chordpitch_to_lily(mxl_cpitch):
return r
chordkind_dict = {
- 'major': r'{}:5',
- 'minor': r'{}:m5',
- 'augmented': r'{}:aug5',
- 'diminished': r'{}:dim5',
+ 'major': r'{}',
+ 'minor': r'{}:m',
+ 'augmented': r'{}:aug',
+ 'diminished': r'{}:dim',
# Sevenths:
'dominant': r'{}:7',
'dominant-seventh': r'{}:7',
@@ -1612,8 +1612,8 @@ chordkind_dict = {
'minor-seventh': r'{}:m7',
'diminished-seventh': r'{}:dim7',
'augmented-seventh': r'{}:aug7',
- 'half-diminished': r'{}:dim5m7',
- 'major-minor': r'{}:maj7m5',
+ 'half-diminished': r'{}:m7.5-',
+ 'major-minor': r'{}:maj7m',
# Sixths:
'major-sixth': r'{}:6',
'minor-sixth': r'{}:m6',
- Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by address@hidden),
pkx166h <=
Re: Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by address@hidden), dak, 2016/10/11