lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: musicxml2ly: Emit bar checks for all voices (issue 553620043 by addr


From: jonas . hahnfeld
Subject: Re: musicxml2ly: Emit bar checks for all voices (issue 553620043 by address@hidden)
Date: Tue, 10 Mar 2020 02:18:11 -0700

Reviewers: Dan Eble,


https://codereview.appspot.com/553620043/diff/581760043/scripts/musicxml2ly.py
File scripts/musicxml2ly.py (right):

https://codereview.appspot.com/553620043/diff/581760043/scripts/musicxml2ly.py#newcode2287
scripts/musicxml2ly.py:2287: if n._measure_position == Rational(0) and n
!= voice._elements[0]:
On 2020/03/10 00:20:12, Dan Eble wrote:
> Is the purpose of n != voice._elements[0] to avoid printing a bar
check at the
> beginning of the first measure?  If so, I would have been less puzzled
if the
> comment were "print a bar check at the beginning of every measure
after the
> first" or simply "print bar checks between measures".

I really have no idea. This condition was the way to fix the problem at
hand, but I'm not really into what the script is doing in detail. I tend
to agree with your analysis though. I'm going with "print bar checks
between measures", thanks for the suggestion.

Description:
musicxml2ly: Emit bar checks for all voices

The script only added them for the first voice, without explanation.
As this change doesn't seem to cause any problems, it's probably fine
to lift this restriction and make the generated code easier to read.

Suggested privately by Kai Ruemmler.

Please review this at https://codereview.appspot.com/553620043/

Affected files (+1, -1 lines):
  M scripts/musicxml2ly.py


Index: scripts/musicxml2ly.py
diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py
index 
a14b1511877b506ce2106b9e681dfdd9b91286d4..03d3f9d8aaa195b38d3ef560eff92fd965af6e06
 100755
--- a/scripts/musicxml2ly.py
+++ b/scripts/musicxml2ly.py
@@ -2284,7 +2284,7 @@ def musicxml_voice_to_lily_voice(voice):
             continue
 
         # print a bar check at the beginning of each measure!
-        if n.is_first() and n._measure_position == Rational(0) and n != 
voice._elements[0]:
+        if n._measure_position == Rational(0) and n != voice._elements[0]:
             try:
                 num = int(n.get_parent().number)
             except ValueError:





reply via email to

[Prev in Thread] Current Thread [Next in Thread]