Alsa 1.0.0rc2 OSS Midi is still broken for recording from external MIDI devices.
The time values of note on and note off events are severely corrupted in
MIDI recordings that contain a sequence of chords of two or more different
notes played at the same time.  However, interestingly, MIDI recordings which
contain only a sequence of _single_ notes work ok because the bug was
partially fixed in alsa-driver-0.9.1 released around 15th March 2003.

Only OSS-mode MIDI recording from /dev/sequencer is broken, e.g. using
an OSS client like the old Rosegarden 2.1pl4 
(http://www.cannam.demon.co.uk/rosegarden/distribution/rosegarden-2.1pl4.tar.gz or 
ftp://ftp.cs.bath.ac.uk/pub/dream/ROSE/rosegarden-2.1-sources.tar.gz)
whereas ALSA-mode MIDI recording works fine, e.g. using the new Rosegarden 4 
(http://heanet.dl.sourceforge.net/sourceforge/rosegarden/rosegarden-4-0.9.5.tar.bz2)

To reproduce this bug, you'd need a MIDI keyboard for sending external MIDI
events to your soundcard and also an OSS client for MIDI recording
which must be the _old_ version 2.1pl4 of Rosegarden (newer versions of
Rosegarden do not do OSS-mode MIDI recording), preferably my statically
linked Rosegarden 2.1pl4: http://www.liam2.demon.co.uk/rosegarden.static.bz2
(sources http://www.liam2.demon.co.uk/rosegarden.tar.bz2)

I made three OSS MIDI recordings to show how to trigger the bug:

Attachment #1: I repeatedly played the ascending notes of the scale of C-major
(or whatever name your locale gives to a 440Hz pitch) one note at a time
at a speed of roughly 1 note/second for about 12 seconds;
this recording plays correctly from beginning to end.

Attachment #2: I played the notes C and E together repeatedly at a
regular speed of roughly 2 chords/second for about 20 seconds;
observe the very irregular, incorrect timing of the recorded notes.

Attachment #3: I repeatedly played the notes C, E and G together at a regular
speed of roughly 2 chords/second for about 20 seconds; notice again the very
irregular, incorrect timing of the notes and also how the MIDI file
has been stretched from 20 seconds of true playing time to over 3 minutes
in playback length.

It is actually the same old bug I reported with full details in my email as
bug #1 ("Every MIDI file recording ... has invalid time ...") with the subject
"[Alsa-devel] Invalid MIDI recordings and silent external playback"
on 26th August 2002.  Please ignore the other bugs mentioned in that email
such as silent external MIDI playback because these have been fixed since
alsa-driver-0.9.1 (external playback is ok using "playmidi -e -D 0 file.mid").

Subject: [Alsa-devel] Invalid MIDI recordings and silent external playback
URL: 
hhttp://www.geocrawler.com/mail/thread.php3?subject=%5BAlsa-devel%5D+Invalid+MIDI+recordings+and+silent+external+playback&list=12349
Additional explanations in two followups on 15th November 2002 with
Subject: [Alsa-devel] OSS-mode invalid MIDI recordings and silent external playback
http://www.geocrawler.com/mail/thread.php3?subject=%5BAlsa-devel%5D+OSS-mode+invalid+MIDI+recordings+and+silent+external+playback&list=12349
Subject: [Alsa-devel] Re: OSS-mode invalid MIDI recordings and silent external playback

Maybe this bug is easy-to-fix so it won't be a showstopper for a 1.0.0 release
but it's been around a very long time, at least since ALSA-0.3.0pre4 in 1999.
I don't know the ALSA driver source well enough to be able to find it.

Thanks,

Will

Attachment: oss1-nobug.mid
Description: MIDI audio

Attachment: oss2-buggy.mid
Description: MIDI audio

Attachment: oss3-verybuggy.mid
Description: MIDI audio

Reply via email to