pedrolcl / drumstick

Drumstick Qt/C++ MIDI libraries (Mirror)
https://sourceforge.net/projects/drumstick/
GNU General Public License v3.0
12 stars 3 forks source link

drumstick-playsmf: error occurs if system exclusive message is followed by channel message that uses running status #23

Closed tatsuki-makino closed 3 months ago

tatsuki-makino commented 3 months ago

drumstick-2.9.0 It has been ported to FreeBSD.

If the SMF file contains a system exclusive message, followed by a channel message that uses the running status, an error occurs. The error is output with a large number of lines as follows.

Warning! Unexpected byte ( b) at 39677 at file offset 39678 Warning! Unexpected byte ( 0) at 39679 at file offset 39680 Warning! Unexpected byte ( 5) at 39681 at file offset 39682 Warning! Unexpected byte ( b) at 39683 at file offset 39684 Warning! Unexpected byte ( 8) at 39685 at file offset 39686 Warning! Unexpected byte ( 7) at 39687 at file offset 39688 Warning! Unexpected byte ( b) at 39689 at file offset 39690 Warning! Unexpected byte ( 8) at 39691 at file offset 39692 Warning! Unexpected byte ( 9) at 39693 at file offset 39694 Warning! Unexpected byte ( b) at 39695 at file offset 39696

Applying a patch like the one in the following attachment would be a workaround for it. patch.txt The patch also includes an offset fix that would have skipped a bad message if it was included in the file.

pedrolcl commented 3 months ago

If the SMF file contains a system exclusive message, followed by a channel message that uses the running status, an error occurs.

Which is the correct behavior, according to Standard MIDI Files specification, page 7:

Sysex events and meta-events cancel any running status which was in effect. Running status does not apply to and may not be used for these messages.