From: Jan Nieuwenhuizen Date: Wed, 19 May 2010 13:53:14 +0000 (+0200) Subject: midi2ly: open midi input file in binary mode. Fixes #834. X-Git-Tag: release/2.13.22-1~16 X-Git-Url: https://git.donarmstrong.com/?a=commitdiff_plain;h=66dd932f6519b7913400a838c5efbc5407e06cd8;p=lilypond.git midi2ly: open midi input file in binary mode. Fixes #834. After some GUB python hacking I decided the problem was not in Python but in midi.c. Then it was easy, I printed the midi_dump midi_dump = midi.parse (str) in wine and compared that with the Linux one wine: ((1, 960), []) linux: ((1, 960), [[(0, (255, 88, '\x04\x02\x18\x08')), (0, [..] and then printed the input STR to that function wine: string:>>> MThd --- diff --git a/scripts/midi2ly.py b/scripts/midi2ly.py index be99ae7977..e0a00ae170 100644 --- a/scripts/midi2ly.py +++ b/scripts/midi2ly.py @@ -801,7 +801,7 @@ def convert_midi (in_file, out_file): global duration_quant_clocks global allowed_tuplet_clocks - str = open (in_file).read () + str = open (in_file, 'rb').read () midi_dump = midi.parse (str) clocks_per_1 = midi_dump[0][1]