SDL_mixer and music syncing?

I’m quite new to SDL and I have not yet figured out how to accomplish
this whole syncing thing. I want to sync a program to the music I’ll get
from a .mod-file. After searching the net for about a week without
finding anything relevant i turned to this list in hope of help.
Is there any website with tutorials or examplecode in this topic?
(Checked SDL_mixer website and that demonstration was just about playing
wav-files as soundeffects) or maybe someone who could write a simple
example for me?

/daniel

That shouldn’t be too hard, I think, but you’ll probably have to build
your own version of SDL_mixer from source.

It looks like the data you want is in music_playing->data.module->??? .
music_playing->data.module is a a pointer to MikMod’s data structure.
This structure includes the members (from mikmod.h):
UWORD patpos; /* current row number /
SWORD sngpos; /
current song position /
ULONG sngtime; /
current song time in 2^-10 seconds */

So I guess you need some kind of access function(s) in music.c to get
either the position numbers you want or the pointer to the whole MODULE struct.

There are other ways. A while ago, someone posted a patch to the list
that generated events on special module commands that are unused by actual
mod formats.

Hope that helps.On Thu, Jan 31, 2002 at 01:08:01AM +0100, Daniel Svensson wrote:

I’m quite new to SDL and I have not yet figured out how to accomplish
this whole syncing thing. I want to sync a program to the music I’ll get
from a .mod-file. After searching the net for about a week without
finding anything relevant i turned to this list in hope of help.
Is there any website with tutorials or examplecode in this topic?
(Checked SDL_mixer website and that demonstration was just about playing
wav-files as soundeffects) or maybe someone who could write a simple
example for me?

/daniel


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl


Greg V. (hmaon)

I’m quite new to SDL and I have not yet figured out how to accomplish
this whole syncing thing. I want to sync a program to the music I’ll get
from a .mod-file. After searching the net for about a week without
finding anything relevant i turned to this list in hope of help.
Is there any website with tutorials or examplecode in this topic?
(Checked SDL_mixer website and that demonstration was just about playing
wav-files as soundeffects) or maybe someone who could write a simple
example for me?

/daniel


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

That shouldn’t be too hard, I think, but you’ll probably have to build
your own version of SDL_mixer from source.

It looks like the data you want is in music_playing->data.module->??? .
music_playing->data.module is a a pointer to MikMod’s data structure.
This structure includes the members (from mikmod.h):
UWORD patpos; /* current row number /
SWORD sngpos; /
current song position /
ULONG sngtime; /
current song time in 2^-10 seconds */

So I guess you need some kind of access function(s) in music.c to get
either the position numbers you want or the pointer to the whole MODULE struct.
There are other ways. A while ago, someone posted a patch to the list
that generated events on special module commands that are unused by actual
mod formats.
How long time ago? searching the archives

-danielOn Thu, 2002-01-31 at 19:29, Greg Velichansky wrote:

On Thu, Jan 31, 2002 at 01:08:01AM +0100, Daniel Svensson wrote:

Hope that helps.


Greg V. (hmaon)


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

I’m really not sure. A long time ago, probably. Half a year to a year ago?On Thu, Jan 31, 2002 at 07:51:46PM +0100, Daniel Svensson wrote:

On Thu, 2002-01-31 at 19:29, Greg Velichansky wrote:

On Thu, Jan 31, 2002 at 01:08:01AM +0100, Daniel Svensson wrote:
There are other ways. A while ago, someone posted a patch to the list
that generated events on special module commands that are unused by actual
mod formats.
How long time ago? searching the archives

-daniel


Greg V. (hmaon)