From: Jan Nieuwenhuizen Date: Fri, 4 Mar 2011 20:31:16 +0000 (+0100) Subject: Midi2ly: add --skip option, print rests by default. Fixes #1549. X-Git-Tag: release/2.13.53-1~14 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=75ac6c7a0a06c35e6a7efb9a01997132a0204f93;hp=78b0afce3906e99e12c8a03de55d49b785dfceb3;p=lilypond.git Midi2ly: add --skip option, print rests by default. Fixes #1549. This was inspired by a patch from Martin Tarenskeen, however, using rests only works in combination with the Completion_rest_engraver. --- diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index ab2fb708d7..c1f3543b88 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -800,7 +800,9 @@ def dump_track (track, n): item = voice_first_item (voice) if item and item.__class__ == Note: - skip = 's' + skip = 'r' + if global_options.skip: + skip = 's' s += '%(voice_id)s = ' % locals () if not global_options.absolute_pitches: s += '\\relative c ' @@ -944,6 +946,8 @@ def convert_midi (in_file, out_file): \Voice \remove "Note_heads_engraver" \consists "Completion_heads_engraver" + \remove "Rest_engraver" + \consists "Completion_rest_engraver" } } ''' @@ -1025,6 +1029,9 @@ def get_option_parser (): action='store_true') p.add_option ('-s', '--start-quant',help= _ ('quantise note starts on DUR'), metavar=_ ('DUR')) + p.add_option ('-S', '--skip', + action = "store_true", + help =_ ("use s instead of r for rests")) p.add_option ('-t', '--allow-tuplet', metavar=_ ('DUR*NUM/DEN'), action = 'append',