SDL_mixer and mikmod

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

Now I can see having a specific version included… probably for
non-linux platforms g.

note: at this time I’m not worried. I cobbled an SDL driver for mikmod
together myself for the app I’m working on… although I’m not sure I’ll
stick to mikmod g.

Just curious…
- Teunis

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

(Not to keep pimping SDL_sound… :slight_smile: )

Torbjorn Andersson just added MikMod support to SDL_sound, and we used the
RWops wrapper from SDL_mixer. As far as I can tell, that’s all it really
needed to get up and running, and it didn’t take much to disentangle it
from the included mikmod and link with the system libmikmod instead.

Timidity, on the other hand, might be another story…

note: at this time I’m not worried. I cobbled an SDL driver for mikmod
together myself for the app I’m working on… although I’m not sure I’ll
stick to mikmod g.

Also reference:
http://cvs.icculus.org/horde/chora/cvs.php/decoders/mod.c?rt=SDL_sound

–ryan.

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

(Not to keep pimping SDL_sound… :slight_smile: )

Torbjorn Andersson just added MikMod support to SDL_sound, and we used the
RWops wrapper from SDL_mixer. As far as I can tell, that’s all it really
needed to get up and running, and it didn’t take much to disentangle it
from the included mikmod and link with the system libmikmod instead.

Timidity, on the other hand, might be another story…

well considering I’m actually working with music synthesis and MIDI
editing, SDL_sound is inappropriate for my purposes. This is probably not
true for most other people :slight_smile:

[clip]

btw - gave up on SDL_MIDI. Still don’t know how MIDI events should be
translated into SDL events but I’ll come up with something. Would be fun
if SDL had “timer” events too…

My Korg Poly-800 II works -beautifully- on linux communicating with MIDI
port bidirectional. I can program new sound effects and read any
event including keypresses, programming, current instrument, pitchblend
and the DCD/VCF measure as well… g. Just FWIW :slight_smile:
(soundcard is SB-16)

My explorations have revealed that wave-audio cards and wave-audio support
in linux is tied closely with the MIDI system. I’m not sure what if
anything this means to SDL, other than with SDL 1.3 it would be good to
support multiple channels on wave-supported cards such as SB Live, Gravis
Ultrasound (yes I’ve still got mine and happy with it :slight_smile: and such. The
current SDL sound system could not support multichannel wave audio under
linux without a number of changes.

G’day, eh? :slight_smile:
- TeunisOn Mon, 24 Sep 2001, Ryan C. Gordon wrote:

At 20:25 Uhr -0700 23.09.2001, winterlion wrote:

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

The libmikmod supplied with SDL_mixer has a custom driver that uses
SDL_audio to output - this is important for platforms that are
supported (audio wise) by SDL but not by libmikmod. Furthermore,
people might want to have all their audio go through SDL_audio for
other reasons, e.g. to be able to do some processing to it or
something…

Maybe it is possible to add a custom driver like this to libmikmod at
runtime, though, I can’t tell since I do not know libmikmod much -
please tell me if this is so.

Now I can see having a specific version included… probably for
non-linux platforms g.

note: at this time I’m not worried. I cobbled an SDL driver for mikmod
together myself for the app I’m working on… although I’m not sure I’ll
stick to mikmod g.

So you mean a driver for libmikmod that feeds its output into
SDL_audio? Is that possible w/o modifiying it at build time then?
Would be nice.

Max–

Max Horn
Software Developer

email: mailto:Max_Horn
phone: (+49) 6151-494890

The libmikmod supplied with SDL_mixer has a custom driver that uses
SDL_audio to output - this is important for platforms that are
supported (audio wise) by SDL but not by libmikmod. Furthermore,
people might want to have all their audio go through SDL_audio for
other reasons, e.g. to be able to do some processing to it or
something…

Theoretically, we’d want to use the NoSound driver with MikMod, so that it
decodes the MOD file into a sound buffer without hijacking the sound card,
etc. In fact, that’s what we do in SDL_sound.

…Unless SDL_mixer is using the SDL “driver” as a callback to catch
decoded data. I haven’t looked that closely, but it’s probably better to
request decoding directly if that is the case.

Maybe it is possible to add a custom driver like this to libmikmod at
runtime, though, I can’t tell since I do not know libmikmod much -
please tell me if this is so.

It is, actually. There’s a Mikmod function (Mikmod_RegisterDriver()) that
takes a pointer to a structure filled with function pointers that will be
used to communicate with your device (or virtual device). Alternately, if
you want it to figure out how to spit out sound, you call
MikMod_RegisterAllDrivers(), and it will figure out how to talk to your
sound card for you.

libMikMod is actually impressively flexible in many ways.

So you mean a driver for libmikmod that feeds its output into
SDL_audio? Is that possible w/o modifiying it at build time then?
Would be nice.

It is, but I still don’t see why it’s necessary for a system that wants to
mix a set of waveforms into a buffer that it feeds to an abstract audio
callback.

Now I’m curious. I’m going to go look. :slight_smile:

–ryan.

It is, but I still don’t see why it’s necessary for a system that wants to
mix a set of waveforms into a buffer that it feeds to an abstract audio
callback.

Now I’m curious. I’m going to go look. :slight_smile:

…and look I did.

The SDL MikMod driver in SDL_mixer is more or less the same as the NoSound
driver. The only notable distinction is this code in the init function:

md_mode |= DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX;

…which more or less speaks for itself. I hadn’t run into a problem on
the NoSound driver, but I would need to check further into the
ramifications of not explicitly setting those flags, and I won’t, because
I’m too lazy. :slight_smile:

–ryan.

“Ryan C. Gordon” wrote:

The SDL MikMod driver in SDL_mixer is more or less the same as the NoSound
driver. The only notable distinction is this code in the init function:

md_mode |= DMODE_SOFT_MUSIC | DMODE_SOFT_SNDFX;

…which more or less speaks for itself. I hadn’t run into a problem on
the NoSound driver, but I would need to check further into the
ramifications of not explicitly setting those flags, and I won’t, because
I’m too lazy. :slight_smile:

If the MikMod documentation is accurate, there shouldn’t be any
ramifications at all because the default value of md_mode is supposed
to be DMODE_STEREO | DMODE_SURROUND | DMODE_16BITS | DMODE_SOFT_MUSIC
| DMODE_SOFT_SNDFX.

A cursory look at the code would seem to confirm this, but I’m too
lazy to check, too. :slight_smile:

Torbj?rn Andersson

At 20:25 Uhr -0700 23.09.2001, winterlion wrote:

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

The libmikmod supplied with SDL_mixer has a custom driver that uses
SDL_audio to output - this is important for platforms that are
supported (audio wise) by SDL but not by libmikmod. Furthermore,
people might want to have all their audio go through SDL_audio for
other reasons, e.g. to be able to do some processing to it or
something…

Maybe it is possible to add a custom driver like this to libmikmod at
runtime, though, I can’t tell since I do not know libmikmod much -
please tell me if this is so.

oh yes it is - if you wish I could send it to you :slight_smile:
I have to admit the approach I took was to take the SDL_mixer "mixer.c"
and fix it up for current mikmod g… (I’m not even sure I had to
-change- anything. I just removed references to the local copy of mikmod :slight_smile:
and heh the sound driver situation’s -exactly- why I looked into this -
mikmod doesn’t mix well with artsd/esd :slight_smile:

and no, the current libmikmod doesn’t require build changes. (3.1.9 :slight_smile:

G’day, eh? :slight_smile:
- TeunisOn Mon, 24 Sep 2001, Max Horn wrote:

and no, the current libmikmod doesn’t require build changes. (3.1.9 :slight_smile:

But it would be nice if there was an SDL output driver in the actual
MikMod distribution. The “driver” in SDL_mixer is a no-op (as it should
be), and while MikMod can mix to a bunch of different APIs, it’d be good
to have an SDL-enabled version for, y’know, World Domination.

Enough about this, though.

Sam/other SDL_mixer maintainers: Should we rip mikmod out of SDL_mixer,
and just leave the RWops-to-mikmod interface in there?

–ryan.

Sam/other SDL_mixer maintainers: Should we rip mikmod out of SDL_mixer,
and just leave the RWops-to-mikmod interface in there?

It doesn’t matter to me, but I don’t use the mikmod stuff myself, and I
can see why it might be helpful to have included for things like the mac
port.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

and no, the current libmikmod doesn’t require build changes. (3.1.9 :slight_smile:

3.1.9 isn’t the current libmikmod, I have seen 3.1.10 (dev version) and the
following comment from Timidity++ is interesting:

2000-10-17 Paolo Bonzini

Merged with libmikmod 3.1.9

http://www.goice.co.jp/member/mo/timidity/

Florian–
Florian ‘Proff’ Schulze - @Florian_Schulze
Homepage: - http://proff.fly.to
PGP-Key available from - http://www.keyserver.net/en/

winterlion wrote:

At 20:25 Uhr -0700 23.09.2001, winterlion wrote:

Is there any particular reason that SDL_mixer can’t use the libmikmod
present? I don’t see any overwhelming necessity for it (I got SDL_mixer
to use existing libmikmod without much change at all)…

The libmikmod supplied with SDL_mixer has a custom driver that uses
SDL_audio to output - this is important for platforms that are
supported (audio wise) by SDL but not by libmikmod. Furthermore,
people might want to have all their audio go through SDL_audio for
other reasons, e.g. to be able to do some processing to it or
something…

Maybe it is possible to add a custom driver like this to libmikmod at
runtime, though, I can’t tell since I do not know libmikmod much -
please tell me if this is so.

oh yes it is - if you wish I could send it to you :slight_smile:
I have to admit the approach I took was to take the SDL_mixer "mixer.c"
and fix it up for current mikmod g… (I’m not even sure I had to
-change- anything. I just removed references to the local copy of mikmod :slight_smile:
and heh the sound driver situation’s -exactly- why I looked into this -
mikmod doesn’t mix well with artsd/esd :slight_smile:

and no, the current libmikmod doesn’t require build changes. (3.1.9 :slight_smile:

I want to add there is also libmodplug, see the xmms plugin:
http://sourceforge.net/projects/modplug-xmms/ and
http://modplug-xmms.sourceforge.net/
which I think performs better than libmikmod, needs no threads and
has a simple API. (Note: the license will be public domain in the
next version.)

But if SDL_sound will support the xmms plugins, which I think is a good
idea, this will automatic be available. But will the plugins work on
all SDL supported platforms?

Bye,
Johns> On Mon, 24 Sep 2001, Max Horn wrote:

Become famous, earn no money, create music or graphics for FreeCraft
http://FreeCraft.Org - A free real-time strategy game engine
http://FreeCraft.Net/fcgp - The FreeCraft Graphics Project
http://FreeCraft.Net/fcsp - The FreeCraft Sound Project

But if SDL_sound will support the xmms plugins, which I think is a good
idea, this will automatic be available. But will the plugins work on
all SDL supported platforms?

If I do it, it’ll be a hack, and probably Linux only (er…and maybe
FreeBSD). It’s more for fun, not world-domination.

It would be better to take code from XMMS plugins and mold it into a
SDL_sound decoder.

–ryan.

Sam Lantinga wrote:

Sam/other SDL_mixer maintainers: Should we rip mikmod out of SDL_mixer,
and just leave the RWops-to-mikmod interface in there?

It doesn’t matter to me, but I don’t use the mikmod stuff myself, and I
can see why it might be helpful to have included for things like the mac
port.

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I think we should definitely keep MikMod included in SDL_Mixer, for all the
people out there who don’t want to spend days trying to write their own
MikMod to SDL interface.

I think we should definitely keep MikMod included in SDL_Mixer, for all the
people out there who don’t want to spend days trying to write their own
MikMod to SDL interface.

Well, THAT would stay.

What I was suggesting is that we not distribute separate libraries as part
of SDL_mixer; it’s more bulk, and we don’t automatically benefit from
patches to libmikmod.

The interface would, of course, stay.

(And bugger all the MacOS users; it WILL be ripped out when I finish with
SDL_sound.)

–ryan.

modplug-xmms has excellent high-quality output for mods, I’ll vouch for it :slight_smile:

-EvilTypeGuyOn Wed, Sep 26, 2001 at 12:18:21AM +0200, Lutz Sammer wrote:

winterlion wrote:
I want to add there is also libmodplug, see the xmms plugin:
http://sourceforge.net/projects/modplug-xmms/ and
http://modplug-xmms.sourceforge.net/
which I think performs better than libmikmod, needs no threads and
has a simple API. (Note: the license will be public domain in the
next version.)