From bb4fc519338b35b6d2636dca6444263a9bc6a588 Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Fri, 30 Nov 2007 13:28:03 +0100 Subject: [PATCH] MusicXML: Prevent negative duration logs (=> CRASH) --- scripts/musicxml2ly.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/musicxml2ly.py b/scripts/musicxml2ly.py index c5e07c2ece..43dc29f7cb 100644 --- a/scripts/musicxml2ly.py +++ b/scripts/musicxml2ly.py @@ -1190,7 +1190,7 @@ class LilyPondVoiceBuilder: duration_factor = 1 duration_log = {1: 0, 2: 1, 4:2, 8:3, 16:4, 32:5, 64:6, 128:7, 256:8, 512:9}.get (diff.denominator (), -1) duration_dots = 0 - if duration_log >= 0: # denominator is a power of 2... + if duration_log > 0: # denominator is a power of 2... if diff.numerator () == 3: duration_log -= 1 duration_dots = 1 -- 2.39.5