[AD] [ alleg-Patches-1647040 ] Patch to optionally revert midi playback to pre-4.1.10

[ Thread Index | Date Index | More lists.liballeg.org/allegro-developers Archives ]


Patches item #1647040, was opened at 2007-01-29 07:37
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305665&aid=1647040&group_id=5665

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Core Library
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Dark Nation (dark_nation)
Assigned to: Nobody/Anonymous (nobody)
Summary: Patch to optionally revert midi playback to pre-4.1.10

Initial Comment:
In 4.1.10, a change was made to the midi playback routines (specifically, process_controller) to pass unknown/unhandled controller values directly to the midi driver.  While this may be the proper way of doing things, it caused, at least for some MIDI files (particularly those created with Anvil Studio) playback to be strange.

So, I've been adding the following patch to Allegro everytime I downloaded it to allow for the old way of doing things.  Thought it might be worth adding permanently.  *shrug*

In src\midi.c, below this:
static int midi_looping;                        /* set during loops */
add this:
int midi_strict = 0;                       /* if 0, then unknown controller values are passed to driver */

in the process_controller function, change this:
      default:
	 if (midi_driver->raw_midi) {
to this:
      default:
	 if (!midi_strict && midi_driver->raw_midi) {


In midi.h, below this:
AL_FUNC(void, lock_midi, (struct MIDI *midi));
add this:
AL_VAR(int, midi_strict);         /* if 0, then unknown controller values are passed to driver */

In misc\dllsyms.lst, below this:
    font_vtable_mono DATA
add this:
    midi_strict DATA

The following were generated by fixdll.sh, so they may not need to be hand-edited, just regenerated.  But, since I didn't see a fixdll.sh in my allegro distribution (and I'm not running Linux anyway), I put them in myself:

In lib\mingw32\allegro.def, below this:
    font_vtable_mono @1379 DATA
add this:
    midi_strict @1380 DATA

In lib\msvc\allegro.def, below this:
    font_vtable_mono @1379 DATA
add this:
    midi_strict @1380 DATA

I'm not 100% sure about this last once, since I don't use bcc.  If this patch gets added, someone may need to double-check it first.

In lib\bcc32\allegro.def, below this:
    _midi_seek = midi_seek
add this:
    _midi_strict = midi_strict

Once this patch is in, set the midi_strict variable to a non-zero number and the playback is reverted to the pre-4.1.10 style.

Thoughts?


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305665&aid=1647040&group_id=5665




Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/