summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Kastrup <dak@gnu.org>2016-07-27 12:02:28 +0200
committerDavid Kastrup <dak@gnu.org>2016-08-03 13:21:24 +0200
commit00a48501c64c8babe77c2ebabcc42dae33a7c026 (patch)
tree1c2711db3ba83b8097a3c323bc9c9b21dff6ffc5
parent46eb67a07e39cf052e5712f2fc5eb90fd7124c74 (diff)
Issue 4945/2: midi2ly should omit redundant chord durations
-rw-r--r--scripts/midi2ly.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py
index 2a36874962..3a29f9aaa1 100644
--- a/scripts/midi2ly.py
+++ b/scripts/midi2ly.py
@@ -655,13 +655,17 @@ def dump_chord (ch):
s = s + dump (notes[0])
elif len (notes) > 1:
global reference_note
+ reference_dur = reference_note.duration
s = s + '<'
s = s + notes[0].dump (dump_dur=False)
r = reference_note
for i in notes[1:]:
s = s + i.dump (dump_dur=False)
s = s + '>'
- s = s + notes[0].duration.dump () + ' '
+ if (r.duration.compare (reference_dur)
+ or global_options.explicit_durations):
+ s = s + r.duration.dump ()
+ s = s + ' '
reference_note = r
return s