X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=scripts%2Fmidi2ly.py;h=2a36874962c8160d31f8fb0d4d4da7b216553126;hb=46eb67a07e39cf052e5712f2fc5eb90fd7124c74;hp=f4a47fb79ab963c889a9d372b9952e89ac3cdbd9;hpb=47db9a3883d726ca53e2133a3b2298f78dd6a32e;p=lilypond.git diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index f4a47fb79a..2a36874962 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -32,7 +32,6 @@ import sys @relocate-preamble@ """ -import midi import lilylib as ly global _;_=ly._ @@ -268,11 +267,13 @@ class Note: elif commas < 0: s = s + "," * -commas - if ((dump_dur - and self.duration.compare (reference_note.duration)) - or global_options.explicit_durations): + if (dump_dur + and (self.duration.compare (reference_note.duration) + or global_options.explicit_durations)): s = s + self.duration.dump () + # Chords need to handle their reference duration themselves + reference_note = self # TODO: move space @@ -923,6 +924,9 @@ class Staff: return dump_track (self.voices, i) def convert_midi (in_file, out_file): + global midi + import midi + global clocks_per_1, clocks_per_4, key global start_quant_clocks global duration_quant_clocks