lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

midi2ly bug + fix


From: Vegard Nossum
Subject: midi2ly bug + fix
Date: Tue, 16 Jan 2007 07:06:31 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

PSS: It seems that the list moderator doesn't want me to post it myself, so I
try gmane again.

PS: It seems that the e-mail form over at
http://post.gmane.org/post.php?group=gmane.comp.gnu.lilypond.devel doesn't
work (I never got the advertised confirmation e-mail), so I'll try sending
this to the list myself.

The initialization of running_status was moved _inside_ the track loop,
thus clearing the status bit before decoding each MIDI event. This created
an extremely subtle bug because it didn't error when run, but instead
produced garbage MIDI events.


>From e76f3a2fee6f4bf28b09c77cbaf56ed376d57d07 Mon Sep 17 00:00:00 2001
From: Vegard Nossum <address@hidden>
Date: Fri, 12 Jan 2007 11:46:28 +0100
Subject: [PATCH] Fixed bug in reading MIDI events with running status

---
 python/midi.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/python/midi.c b/python/midi.c
index facf064..5b78e96 100644
--- a/python/midi.c
+++ b/python/midi.c
@@ -304,10 +304,10 @@ midi_parse_track (unsigned char **track,

   {
     PyObject *pytime = PyInt_FromLong (0L);
+    unsigned char running_status = 0;
+
     while (*track < track_end)
       {
-       unsigned char running_status = 0;
-
        long dt = get_variable_length_number(track, track_end);
        PyObject *pyev = 0;

-- 
1.4.2.3





reply via email to

[Prev in Thread] Current Thread [Next in Thread]