</pitch>
<duration>1024</duration>
<voice>1</voice>
- <type>longa</type>
+ <type>long</type>
</note>
</measure>
<!--=======================================================-->
</pitch>
<duration>1536</duration>
<voice>1</voice>
- <type>longa</type>
+ <type>long</type>
<dot/>
</note>
</measure>
</pitch>
<duration>1792</duration>
<voice>1</voice>
- <type>longa</type>
+ <type>long</type>
<dot/>
<dot/>
</note>
<octave>4</octave>
</pitch>
<duration>8</duration>
- <tie/>
<voice>1</voice>
<type>whole</type>
</note>
<attributes>
<divisions>1</divisions>
<key>
- <key-step>3</key-step>
+ <key-step>F</key-step>
<key-alter>1</key-alter>
- <key-step>5</key-step>
+ <key-step>A</key-step>
<key-alter>-1</key-alter>
- <key-step>6</key-step>
+ <key-step>B</key-step>
<key-alter>-1</key-alter>
</key>
<time>
<measure number="2">
<attributes>
<key>
- <key-step>0</key-step>
+ <key-step>C</key-step>
<key-alter>-2</key-alter>
- <key-step>4</key-step>
+ <key-step>G</key-step>
<key-alter>2</key-alter>
- <key-step>1</key-step>
+ <key-step>D</key-step>
<key-alter>-1</key-alter>
- <key-step>6</key-step>
+ <key-step>B</key-step>
<key-alter>1</key-alter>
- <key-step>5</key-step>
+ <key-step>F</key-step>
<key-alter>0</key-alter>
<key-octave number="1">2</key-octave>
<key-octave number="2">3</key-octave>
<attributes>
<divisions>1</divisions>
<key>
- <key-step>4</key-step>
+ <key-step>G</key-step>
<key-alter>-1.5</key-alter>
- <key-step>5</key-step>
+ <key-step>A</key-step>
<key-alter>-1</key-alter>
- <key-step>6</key-step>
+ <key-step>B</key-step>
<key-alter>-0.5</key-alter>
- <key-step>0</key-step>
+ <key-step>C</key-step>
<key-alter>0</key-alter>
- <key-step>1</key-step>
+ <key-step>D</key-step>
<key-alter>0.5</key-alter>
- <key-step>2</key-step>
+ <key-step>E</key-step>
<key-alter>1</key-alter>
- <key-step>3</key-step>
+ <key-step>F</key-step>
<key-alter>1.5</key-alter>
</key>
<time>
<chord/>
<pitch>
<step>F</step>
- <octave>4</octave>
<alter>1</alter>
+ <octave>4</octave>
</pitch>
<duration>1</duration>
<voice>1</voice>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<pitch>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<chord/>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<chord/>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<chord/>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<rest/>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<note>
<rest>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <notehead parentheses="yes"/>
+ <notehead parentheses="yes">normal</notehead>
</note>
<barline location="right">
<bar-style>light-heavy</bar-style>
<identification>
<miscellaneous>
<miscellaneous-field name="description">Some grace notes and after-graces
- (indicated by steal-time-previous and steal-time-next).</miscellaneous-field>
+ (indicated by steal-time-previous and steal-time-following).</miscellaneous-field>
</miscellaneous>
</identification>
<part-list>
<staff>1</staff>
</note>
<note>
- <grace steal-time-next="20"/>
+ <grace steal-time-following="20"/>
<pitch>
<step>A</step>
<octave>5</octave>
<duration>1</duration>
<voice>1</voice>
<type>quarter</type>
- <lyric number="1"><syllabic>continue</syllabic><text>change</text></lyric>
+ <lyric number="1"><syllabic>middle</syllabic><text>change</text></lyric>
</note>
<note>
<pitch><step>C</step><octave>4</octave></pitch>
<direction>
<direction-type>
<scordatura>
- <accord string="0"><tuning-step>C</tuning-step><tuning-octave>3</tuning-octave></accord>
- <accord string="1"><tuning-step>G</tuning-step><tuning-octave>5</tuning-octave></accord>
- <accord string="2"><tuning-step>E</tuning-step><tuning-octave>5</tuning-octave></accord>
+ <accord string="3"><tuning-step>C</tuning-step><tuning-octave>3</tuning-octave></accord>
+ <accord string="2"><tuning-step>G</tuning-step><tuning-octave>5</tuning-octave></accord>
+ <accord string="1"><tuning-step>E</tuning-step><tuning-octave>5</tuning-octave></accord>
</scordatura>
</direction-type>
</direction>
<wavy-line placement="below" type="start"/>
</ornaments>
</notations>
- <lyric number="1"><syllabic>continue</syllabic><text>wavy</text></lyric>
+ <lyric number="1"><syllabic>middle</syllabic><text>wavy</text></lyric>
</note>
<note>
<pitch>
<voice>1</voice>
<type>quarter</type>
<notations>
- <ornaments><tremolo/></ornaments>
+ <ornaments><tremolo>3</tremolo></ornaments>
</notations>
<lyric number="1"><text>trem.</text></lyric>
</note>
</measure>
<!--=======================================================-->
<measure number="19">
- <direction>
- <direction-type>
- <grouping type="start"/>
- </direction-type>
- </direction>
+ <grouping type="start"/>
<note>
<pitch>
<step>B</step>
<voice>1</voice>
<type>quarter</type>
</note>
- <direction>
- <direction-type>
- <grouping type="stop"/>
- </direction-type>
- </direction>
+ <grouping type="stop"/>
</measure>
<!--=======================================================-->
<measure number="20">
<voice>1</voice>
<type>quarter</type>
<notations>
- <ornaments><tremolo type="stop"/></ornaments>
+ <ornaments><tremolo type="stop">2</tremolo></ornaments>
</notations>
</note>
<note>
<root-step>C</root-step>
</root>
<kind>minor-ninth</kind>
- <lyric number="1"><text>minor-ninth</text></lyric>
</harmony>
<note>
<pitch><step>C</step><octave>4</octave></pitch>
'longa': -2,
'long': -2}.get (dur, 0)
+
+
def interpret_alter_element (alter_elm):
alter = 0
if alter_elm:
return step
def get_octave (self):
ch = self.get_unique_typed_child (get_class (u'octave'))
-
- step = ch.get_text ().strip ()
- return int (step)
+ octave = ch.get_text ().strip ()
+ return int (octave)
def get_alteration (self):
ch = self.get_maybe_exist_typed_child (get_class (u'alter'))
current_step = 0
for i in key.get_all_children ():
if isinstance (i, KeyStep):
- current_step = int (i.get_text ())
+ current_step = i.get_text ().strip ()
elif isinstance (i, KeyAlter):
alterations.append ([current_step, interpret_alter_element (i)])
elif isinstance (i, KeyOctave):
def get_step (self):
ch = self.get_maybe_exist_typed_child (get_class (u'display-step'))
if ch:
- step = ch.get_text ().strip ()
- return step
+ return ch.get_text ().strip ()
else:
return None
def get_octave (self):
ch = self.get_maybe_exist_typed_child (get_class (u'display-octave'))
if ch:
- step = ch.get_text ().strip ()
- return int (step)
+ oct = ch.get_text ().strip ()
+ return int (oct)
else:
return None
error_message (_ ("Unprocessed PartGroupInfo %s encountered") % self)
return ''
+def musicxml_step_to_lily (step):
+ if step:
+ return (ord (step) - ord ('A') + 7 - 2) % 7
+ else:
+ return None
+
+
def staff_attributes_to_string_tunings (mxl_attr):
details = mxl_attr.get_maybe_exist_named_child ('staff-details')
if not details:
else:
# Non-standard key signature of the form [[step,alter<,octave>],...]
- change.non_standard_alterations = key_sig
+ # MusicXML contains C,D,E,F,G,A,B as steps, lily uses 0-7, so convert
+ alterations = []
+ for k in key_sig:
+ k[0] = musicxml_step_to_lily (k[0])
+ alterations.append (k)
+ change.non_standard_alterations = alterations
return change
def musicxml_transpose_to_lily (attributes):
self.lyrics_dict = {}
self.lyrics_order = []
-def musicxml_step_to_lily (step):
- if step:
- return (ord (step) - ord ('A') + 7 - 2) % 7
- else:
- return None
-
def measure_length_from_attributes (attr, current_measure_length):
len = attr.get_measure_length ()
if not len: