Re: Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by pkx1...@gmail.com)

2016-10-07 Thread Johan Vromans
On Fri, 07 Oct 2016 07:45:53 -0700
d...@gnu.org wrote:

> https://codereview.appspot.com/305700043/diff/1/python/musicexp.py
> File python/musicexp.py (right):
> 
> https://codereview.appspot.com/305700043/diff/1/python/musicexp.py#newcode1608
> python/musicexp.py:1608: # digit. If none, omit the ".".
> I think this behavior is wrong since the first digit is _not_ a mere
> addition but determines the "stacking height" of the preceding chord.
> See, for example, the output of
> 
> \chordmode { c:dim3.5.13 c:dim13 }
> 
> for the difference.

Yes, that's right.

Cdim13 (in MuseScore) becomes MusicXML C + dim7 + 9 + 11 + 13.

Cdim(add13) becomes C + dim + 13. This would then be translated to Cdim13.

> The pattern \d$ also is not sufficient since it
> does not cover 5- (for example).  Maybe something like r':.*?\d' would
> do the trick?

The bottom line is: What is required in chord c:blah so that .NN can be
added as a pure addition. It is unfortunate that c:.13 is invalid syntax.

While we're at it: A couple of lines later (line 1617):

if self.bass:
value += "/+%s" % self.bass.ly_expression ()

AFAIK, a bass note is written as /c, not /+c.

Thanks for chiming in!

-- Johan

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Re: Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by pkx1...@gmail.com)

2016-10-07 Thread dak


https://codereview.appspot.com/305700043/diff/1/python/musicexp.py
File python/musicexp.py (right):

https://codereview.appspot.com/305700043/diff/1/python/musicexp.py#newcode1608
python/musicexp.py:1608: # digit. If none, omit the ".".
I think this behavior is wrong since the first digit is _not_ a mere
addition but determines the "stacking height" of the preceding chord.
See, for example, the output of

\chordmode { c:dim3.5.13 c:dim13 }

for the difference.  So for better or worse, if we don't have a digit in
the chord so far, we need to add 3.5. before other additions rather than
omitting . altogether.  The pattern \d$ also is not sufficient since it
does not cover 5- (for example).  Maybe something like r':.*?\d' would
do the trick?  That's a digit anywhere after : .

https://codereview.appspot.com/305700043/

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


PATCHES: Countdown for October 7th

2016-10-07 Thread James

Hello,

Here is the current patch countdown list. The next countdown will be on
October 11th.

A quick synopsis of all patches currently in the review process can be
found here:

http://philholmes.net/lilypond/allura/


__


Push:

4974 Add output-attributes grob property to replace id - Paul Morris
https://sourceforge.net/p/testlilyissues/issues/4974
http://codereview.appspot.com/308430043


Countdown:


4980 Fix issue where Musicxml2ly generates improper code for minor 
chords - James Lowe (on behalf of Johan Vromans)

https://sourceforge.net/p/testlilyissues/issues/4980
http://codereview.appspot.com/305700043


4979 Pitched trill: ledger lines are connected - Paul Morris
https://sourceforge.net/p/testlilyissues/issues/4979
http://codereview.appspot.com/308560043


Review:


4937 [GSoC] Implement cross-voice dynamic spanners - Nathan Chou
https://sourceforge.net/p/testlilyissues/issues/4937
http://codereview.appspot.com/304160043


New: No new patches at this time.


Regards

James

___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel



___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel


Musicxml2ly: Fix incorrect conversion of Minor Chords (issue 305700043 by pkx1...@gmail.com)

2016-10-07 Thread pkx166h

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',



___
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel