[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
fix to support breves and longas in musicxml2ly
From: |
David Fletcher |
Subject: |
fix to support breves and longas in musicxml2ly |
Date: |
Tue, 20 May 2008 16:27:47 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
When I ran musicxml2ly on a music XML file containing breves e.g.
<duration>16</duration>
<voice>1</voice>
<type>breve</type>
it crashed in ly_expression with
ValueError: negative shift count
I fixed this by changing musicexp.py in the python folder, replacing line
152: str = '%d%s' % (1 << self.duration_log, '.'*self.dots)
with
152: if self.duration_log >= 0:
153: str = '%d%s' % (1 << self.duration_log, '.'*self.dots)
154: elif self.duration_log ==-1:
155: str = '\\breve%s' % ( '.'*self.dots)
156: elif self.duration_log ==-2:
157: str = '\\longa%s' % ( '.'*self.dots)
158: else:
159: str = '\\maxima%s' % ( '.'*self.dots) #error: durations >
longa not supported
Sorry if that's not the format for a fix.
http://lilypond.org/web/devel/participating/ says
"If you want to contribute fixes of any kind, use the following procedure
Check out the latest sources via GIT at git.sv.gnu.org
git clone git://git.sv.gnu.org/lilypond.git"
I don't use Unix/Linux and the only git I know is me (an old one - a systems
programmer since 1964). I have never written any Python before but the above
fix seems to work, at least for breves.
David
- fix to support breves and longas in musicxml2ly,
David Fletcher <=