Hi!

There is a bug report about hydrogen in Debian that contains a patch.
Maybe you want to have a look:

    http://bugs.debian.org/661725


Cheers

PS: I've already sent this e-mail on March, 3rd, but it was awaiting
moderation (which, according to the archive, never happened), since I
wasn't subscribed to the list.

After one months of silence, I've decided to file a bug report in your
ticket system, but despite the fact that I'm logged in via OpenID,
there's no "new ticket" button. I've learned about this button from the
video. Yes, there's really a video about a ticket tool. Never seen
anything like this.

To sum it up: one has to subscribe to a mailing list or do some magic
dance to get a patch to the devs. In total, I might have spent 20mins
just to foward you this five line diff.

Maybe you want to consider using github or at least a ticket system that
just works.


-------- Original Message --------
Subject: Bug#661725: hydrogen: JACK MIDI sends note-off events instead of note-on
Resent-Date: Wed, 29 Feb 2012 22:24:02 +0000
Resent-From: Roland Mas <[email protected]>
Resent-To: [email protected]
Resent-CC: Debian Multimedia Maintainers <[email protected]>
Date: Wed, 29 Feb 2012 23:21:00 +0100
From: Roland Mas <[email protected]>
Reply-To: Roland Mas <[email protected]>, [email protected]
To: [email protected]

Roland Mas, 2012-02-29 19:46:53 +0100 :

[...]

With ALSA:
t0: note-off for the current instrument
t0: note-on
t0+length of the current sample: note-off

With JACK:
t0: note-off for the *previous* instrument
t0+length of the current sample: note-on for the current instrument

   It occurs to me that there are actually two bugs in there.
1. the lack of the first note-off event for the current sample;
2. the lagging of the events.

Number 1 could be argued not to be a bug; after all, the note-off is
only there as a safety net.  However, number 2 seems to be that the
events that are actually sent lag by one event behind those that are
enqueued, which is why t0 includes the note-off related to the previous
instrument.

Further debugging leads me to the included patch.  I added the note-off
event too (second hunk).  The fix is tested here, but I'd appreciate
upstream review of course :-)



Description: Fix off-by-one error in JACK MIDI
 Fixed bug whereby a MIDI event is only sent when there is another
 one queued.
Author: Roland Mas <[email protected]>
Bug-Debian: http://bugs.debian.org/661725

--- hydrogen-0.9.6~beta1.orig/src/core/src/IO/jack_midi_driver.cpp
+++ hydrogen-0.9.6~beta1/src/core/src/IO/jack_midi_driver.cpp
@@ -222,11 +222,12 @@ JackMidiDriver::JackMidiRead(jack_nframe
 		if (buffer == NULL)
 			break;
 
-                memcpy(buffer, jack_buffer + (4 * rx_in_pos) + 1, len);
 		t++;
 		rx_in_pos++;
 		if (rx_in_pos >= JACK_MIDI_BUFFER_MAX)
 			rx_in_pos = 0;
+
+                memcpy(buffer, jack_buffer + (4 * rx_in_pos) + 1, len);
 	}
 	unlock();
 }
@@ -379,6 +380,13 @@ void JackMidiDriver::handleQueueNote(Not
 	if (vel < 0 || vel > 127)
 		return;
 
+        buffer[0] = 0x80 | channel;	/* note off */
+	buffer[1] = key;
+	buffer[2] = 0;
+	buffer[3] = 0;
+
+	JackMidiOutEvent(buffer, 3);
+
 	buffer[0] = 0x90 | channel;	/* note on */
 	buffer[1] = key;
 	buffer[2] = vel;


Roland.
-- 
Roland Mas

Le weblog entièrement nu -- http://roland.entierement.nu/
Le photoblog entièrement net -- http://roland.entierement.net/


_______________________________________________
pkg-multimedia-maintainers mailing list
[email protected]
http://lists.alioth.debian.org/cgi-bin/mailman/listinfo/pkg-multimedia-maintainers

------------------------------------------------------------------------------
This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 
http://p.sf.net/sfu/sfd2d-msazure
_______________________________________________
Hydrogen-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/hydrogen-devel

Reply via email to