OLD | NEW |
1 #!@TARGET_PYTHON@ | 1 #!@TARGET_PYTHON@ |
2 # -*- coding: utf-8 -*- | 2 # -*- coding: utf-8 -*- |
3 import optparse | 3 import optparse |
4 import sys | 4 import sys |
5 import re | 5 import re |
6 import os | 6 import os |
7 import string | 7 import string |
8 import codecs | 8 import codecs |
9 import zipfile | 9 import zipfile |
10 import tempfile | 10 import tempfile |
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
366 staff = musicexp.RhythmicStaff() | 366 staff = musicexp.RhythmicStaff() |
367 elif clef_sign == "percussion": | 367 elif clef_sign == "percussion": |
368 staff = musicexp.DrumStaff() | 368 staff = musicexp.DrumStaff() |
369 # staff.drum_style_table = ??? | 369 # staff.drum_style_table = ??? |
370 elif clef_sign == "tab": | 370 elif clef_sign == "tab": |
371 staff = musicexp.TabStaff() | 371 staff = musicexp.TabStaff() |
372 staff.string_tunings = staff_attributes_to_string_tunings(attributes) | 372 staff.string_tunings = staff_attributes_to_string_tunings(attributes) |
373 # staff.tablature_format = ??? | 373 # staff.tablature_format = ??? |
374 else: | 374 else: |
375 staff = musicexp.Staff() | 375 staff = musicexp.Staff() |
376 # TODO: Handle case with lines <> 5! | 376 # TODO: Handle case with lines != 5! |
377 if(lines != 5): | 377 if lines != 5: |
378 staff.add_context_modification("\\override StaffSymbol #'line-count
= #%s" % lines) | 378 staff.add_context_modification("\\override StaffSymbol #'line-count
= #%s" % lines) |
379 | 379 |
380 return staff | 380 return staff |
381 | 381 |
382 def extract_instrument_sound(score_part): | 382 def extract_instrument_sound(score_part): |
383 score_instrument = score_part.get_maybe_exist_named_child('score-instrument'
) | 383 score_instrument = score_part.get_maybe_exist_named_child('score-instrument'
) |
384 if not score_instrument: | 384 if not score_instrument: |
385 return None | 385 return None |
386 sound = score_instrument.get_maybe_exist_named_child('instrument-sound') | 386 sound = score_instrument.get_maybe_exist_named_child('instrument-sound') |
387 if sound: | 387 if sound: |
(...skipping 1840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2228 for number in lyrics.keys(): | 2228 for number in lyrics.keys(): |
2229 extracted_lyrics = extract_lyrics(voice, number, lyrics) | 2229 extracted_lyrics = extract_lyrics(voice, number, lyrics) |
2230 | 2230 |
2231 for idx, n in enumerate(voice._elements): | 2231 for idx, n in enumerate(voice._elements): |
2232 tie_started = False | 2232 tie_started = False |
2233 if n.get_name() == 'forward': | 2233 if n.get_name() == 'forward': |
2234 continue | 2234 continue |
2235 staff = n.get_maybe_exist_named_child('staff') | 2235 staff = n.get_maybe_exist_named_child('staff') |
2236 if staff: | 2236 if staff: |
2237 staff = staff.get_text() | 2237 staff = staff.get_text() |
2238 if current_staff and staff <> current_staff and not n.get_maybe_exis
t_named_child('chord'): | 2238 if current_staff and staff != current_staff and not n.get_maybe_exis
t_named_child('chord'): |
2239 voice_builder.add_command(musicexp.StaffChange(staff)) | 2239 voice_builder.add_command(musicexp.StaffChange(staff)) |
2240 current_staff = staff | 2240 current_staff = staff |
2241 | 2241 |
2242 if isinstance(n, musicxml.Partial) and n.partial > 0: | 2242 if isinstance(n, musicxml.Partial) and n.partial > 0: |
2243 a = musicxml_partial_to_lily(n.partial) | 2243 a = musicxml_partial_to_lily(n.partial) |
2244 if a: | 2244 if a: |
2245 voice_builder.add_partial(a) | 2245 voice_builder.add_partial(a) |
2246 figured_bass_builder.add_partial(a) | 2246 figured_bass_builder.add_partial(a) |
2247 chordnames_builder.add_partial(a) | 2247 chordnames_builder.add_partial(a) |
2248 fretboards_builder.add_partial(a) | 2248 fretboards_builder.add_partial(a) |
(...skipping 1018 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3267 options.compressed = True | 3267 options.compressed = True |
3268 | 3268 |
3269 if filename and (filename == "-" or os.path.exists(filename)): | 3269 if filename and (filename == "-" or os.path.exists(filename)): |
3270 voices = convert(filename, options) | 3270 voices = convert(filename, options) |
3271 else: | 3271 else: |
3272 ly.error(_("Unable to find input file %s") % basefilename) | 3272 ly.error(_("Unable to find input file %s") % basefilename) |
3273 sys.exit(1) | 3273 sys.exit(1) |
3274 | 3274 |
3275 if __name__ == '__main__': | 3275 if __name__ == '__main__': |
3276 main() | 3276 main() |
OLD | NEW |