I believe SDL_sound does the same technique of WAV conversion for MIDI
as SDL_mixer does so you could still use OpenAL.
I don’t know if using both SDL_mixer and OpenAL simultaneously is
going to work consistently across platforms. I have flashbacks to old
Win95 (and 3.1 era) where you would get 'Resource already in use’
errors. I do know that libmikmod is not reentrant and if SDL_mixer and
SDL_sound are both active and using it, you will have serious
‘Native’ MIDI is usually a different device/resource on systems, but
all SDL_mixer and SDL_sound are doing is converting them to be played
back like a WAV. I’ve always had a soft spot for MIDI, but the truth
is that MIDI is pretty much dead outside the musician realm. In my
opinion, if all you care about is background music, you’re much better
off dropping MIDI and not worrying about it. If you use MIDIs, you
will be at the mercy of the quality of samples SDL_sound and
SDL_mixer’s converters use which aren’t stellar. If there are MIDIs
you really like and want to use, you are much better off getting an
old Roland Sound Canvas or Yamaha MU (or both) and recording the song
to WAV (or MP3, Ogg, etc) and just using that and shipping the
recording ensuring everybody gets a high quality sound track. (Some
old games at the end of the MIDI era shipped both MIDI support and
recorded music. The recorded music was often a recording of the MIDI
playback on the Roland Sound Canvas SCC-1 or SC-55. Recorded music was
enabled if you kept the CD in the drive so everybody could experience
a higher quality of music and didn’t require you to own a Sound
Canvas. Warcraft 2 did it this way.)
Conversely, you could also write or find something that accesses the
MIDI device directly so MIDI gets played back on the separate/native
device. (PortMusic/PortMIDI might do this.) And FYI, native MIDI would
give you incredible control over ‘rate conversion’ as you can
dynamically change the key (e.g. octave) and tempo independently
without requiring one affecting the other. But for instrument/playback
quality, you will be at the mercy of the built in MIDI device on the
system, and a lot of them are really bad. This is why MIDI has such a
bad reputation among the mainstream.
-EricOn 8/6/07, Sylvain Beucler wrote:
On Mon, Aug 06, 2007 at 10:47:57PM +0200, Torsten Giebl wrote:
Or maybe I should just try to implement rate conversion in
SDL_mixer is really meant to be a simple
play music in the background
and some samples in the foreground.
It was never meant to be a Sound System.
Have you tried Ryan’s SDL Sound ?
Sorry, I meant that I need the audio library to play unmodified MIDIs
as background and play WAVs at various rates (I don’t plan to apply
rate conversion on MIDIs).
I’ll see what I can do with using different libraries for those 2
SDL mailing list
SDL at lists.libsdl.org