We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1267

Summary: Adding a few technical improvements to MIDI playback
Product: SDL_mixer Reporter: Mason Wheeler <masonwheeler>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: WAITING --- QA Contact: Sam Lantinga <slouken>
Severity: enhancement    
Priority: P2 CC: omarandemad
Version: unspecified   
Hardware: x86   
OS: Windows 7   
Attachments: Patch for enhanced MIDI playback functionality.

Description Mason Wheeler 2011-08-06 22:27:05 UTC
Created attachment 668 [details]
Patch for enhanced MIDI playback functionality.

This patch introduces two changes to native_midi_win32.c, and the logic is simple enough that it could probably be applied to other MIDI playback systems without too much trouble.

1.  The stream-reading logic will watch for silence at the beginning of a track and cull it.  Some MIDIs, for whatever reason, begin with 2 seconds or more of silence, which can make working with them awkward.
2.  The stream reader will watch for control event #111, the loop marker, and set a new field on the song structure if it finds it.  The playback logic is altered so that it will no longer stop playing at the end of a song if the loop marker variable is set, but will instead loop to that position.
Comment 1 Sam Lantinga 2011-12-31 11:17:19 UTC
Nice!
I don't want to have a difference in functionality between win32 and the other platforms though.  Is this something you can add for the other MIDI backends as well as timidity?