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

2016-10-12 Thread David Kastrup
David Nalesnik  writes:

> On Wed, Oct 12, 2016 at 5:52 AM, David Kastrup  wrote:
>
>> Bonus points for recognizing the fragment...
>
> Toccata and Fugue in D minor, BWV 565?

Ah, I should have removed the treble staff altogether so that you'd have
been forced to decipher the accordion chord notation in the left hand.

The chord progression in the right hand is probably characteristic
enough on its own, at least when adding the non-chord bass notes.

I've not actually played this adaption by Anzaghi for standard bass
since I have acquired an instrument with free bass manual since then.
So there is no real point in not playing the organ version mostly.

But the score has nevertheless been useful occasionally as a reference
for particular notational elements.

-- 
David Kastrup

___
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-12 Thread David Nalesnik
On Wed, Oct 12, 2016 at 5:52 AM, David Kastrup  wrote:

> Bonus points for recognizing the fragment...

Toccata and Fugue in D minor, BWV 565?

DN

P.S. Sorry, nothing apropos the main topic!

___
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-12 Thread David Kastrup
Johan Vromans  writes:

>> > 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.
>
> Since MusicXML additions are pure additions, would it be safe to turn these
> into (addNN)?
>
> E.g. C + 13 => c:(add13)

Uh, we don't have syntax like that as _input_ syntax?  You mean, allow
c:add13 here?

> Even though that will turn a friendly C13 (user input) via C + 7 + 9 + 11 +
> 13 (MusicXML) into an ugly c:(add7)(add9)(add11)(add13) (LilyPond)...
>
> Otherwise, I'd go for the origional idea of parsing for a preceding digit,
> optionally followed by '+' or '-' (if that would cover all).

Frankly, the .xxx syntax essentially already means "add".  I happen to
be partial to creating a "major" modifier.

Here is how the Italian accordionists do it:


Bonus points for recognizing the fragment...

Here is a somewhat expansive description:


>From the various notations, I find that "M" does fit LilyPond's existing
schemes best as a "major" modifier.

I am not convinced at how the following are rendered.  Particularly c:m5
seems nonsensical, but I'm not too enthusiastic about the others either.

\chordmode { c:dim5 c:m5 c:5 c:maj5 }

Maybe just kill the special effect of "5" whenever it is not first?
There is also the possibility of "whenever it is not alone", but I am
less convinced about what that would do to c:5.6 and similar.

-- 
David Kastrup
___
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-12 Thread Johan Vromans
> > 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.

Since MusicXML additions are pure additions, would it be safe to turn these
into (addNN)?

E.g. C + 13 => c:(add13)

Even though that will turn a friendly C13 (user input) via C + 7 + 9 + 11 +
13 (MusicXML) into an ugly c:(add7)(add9)(add11)(add13) (LilyPond)...

Otherwise, I'd go for the origional idea of parsing for a preceding digit,
optionally followed by '+' or '-' (if that would cover all).

___
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-11 Thread dak

On 2016/10/07 17:31:40, jvromans_squirrel.nl wrote:


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.


An inversion is written as /c but an additional bass note is /+c .  See
the manual for more information.

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

___
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-11 Thread pkx166h

On 2016/10/07 17:31:40, jvromans_squirrel.nl wrote:

On Fri, 07 Oct 2016 07:45:53 -0700
mailto: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

Johan,

Does this mean you are going to provide a new patch or something else?

James


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

___
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 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


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