Re: [AD] MIDI player missing sustain

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


On Sun, 2003-06-08 at 20:08, Chris Jones wrote:
> Here's a report I got recently:
> "I have a MIDI, that's essentially a piano solo, which makes extensive use
> of the sustain midi control. It plays fine with any media player; winamp,
> winMP, whatever, but when I use it with allegro, for some reason the sustain
> control doesn't function, leaving a very staccato and weird sounding piece.
> I've tried using both midi formats (1 and 0) to no avail."
> http://www.agsforums.com/sustain.mid
> 
> Is this a known problem with the allegro MIDI player, and is anyone who
> understands how it works still around?

Looking at the process_midi_event function in src/midi.c, Allegro seems
to only process the following MIDI commands: 0x8, 0x9, 0xB, 0xC, 0xE. So
it can start/stop notes and change instruments, everything else is
ignored.
A simple fix when not using the DIGMID driver would be to just pass
every MIDI command on to the MIDI driver. I have no idea if it would
work, and I can't test it since ALSA's MIDI driver doesn't work for me -
but if you want to add it, try just passing every MIDI command which
gets read in in process_midi_event directly to the raw_midi driver.

For the DIGMID driver, I see no hope for fixing it at all. One would
have to start implementing all the functions in Allegro's voice-API
marked as "not currently implemented" ever since they were added.

In case you only use MIDI as a simple way to add music to an
Allegro-game, maybe you can convert the MIDI file to a MOD and use one
of the various MOD addons for allegro (e.g. DUMB).

-- 
Elias Pschernig <elias@xxxxxxxxxx>





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