0
0

Please let me know if I am missing something obvious…

It seems to me that it would be useful to have a version of FMUSIC_CALLBACK that was NOT latency-adjusted. For example, if I’m in pattern 1 but I want to follow it with either pattern 2 or pattern 3 ( depending on what happens in the game or the tension level or whatever), it seems like if I wait for an OrderCallback and then do FMUSIC_SetOrder, I’ll be too late by the number of samples already mixed that haven’t been heard yet.

Or, if there was a way I could access the song’s order-list and change it while the song is playing, I guess that would be better since that could work without depending on callbacks. plus it would be pretty slick to be able to assemble multiple songs out of patterns contained in 1 mod file. Any chance of that? ๐Ÿ˜•

-Peter

  • You must to post comments
0
0

Oops.. spoke too soon. The text output looks right now, but the sound is messed up.

In my test program, I start over from order 0, but instead it now continues to play where it is, and the next time the order change it change to 1. I don’t express myself too clearly, but if you listen to it, you’ll know what I mean.

  • You must to post comments
0
0

Downloads file
Turns off CD
Starts test program…
Nice!
Edits test program to play another file…
Hooray! Now I’m happy. ๐Ÿ˜€

Thanks one more time.

  • You must to post comments
0
0

That’s great that it’s planned for v4. That one feature (mixtime callbacks) suddenly opens up tons of possibilities.

Is there any way to hack this into the current version? I have a few ideas about ugly ways to do it, like having one “dummy” song with no notes just to provide timing callbacks, syncing the playback of the “real” one to that so that the dummy song’s patterns hopefully will play at (latency) ms before the real one’s. So in a perfect world, the dummy song’s (latency-adjusted) row callbacks will be more or less in sync with the mix-time of the real song… would this maybe work ?

  • You must to post comments
0
0

OK – emailing you. that would be really useful

Also noticing that although FMUSIC_CALLBACK is listed as supported on PS2, none of its implementations are. Is that something that will ever change? If not, then some way to allow branching music other than callbacks or polling – like being able to queue up the next pattern/song to play when the current one is done – would be great. actually that would be great on any platform since it would be so much easier than using callbacks.

  • You must to post comments
0
0

[quote="brett":d9bilxgt]i might add a flag to fsound_init for 3.62 to turn off all latency adjusting, then you can do adjustments or information retrieval at mix time from a dsp unit callback (the best way to get accurate timing at mix time in fmod)[/quote:d9bilxgt]
Yes!

Funny thing is that I registered at these forums today with the intent of posting a post exactly like the one starting this thread. ๐Ÿ˜€ I 100% second the suggestion for a FMUSIC_SetNextOrder() or something. That would make interactive jumps a breeze, but just getting rid of the latency adjusting would be enough to make me happy.

  • You must to post comments
0
0

I tried the new dll. Now nothing at all happens if I call FMUSIC_SetOrder from within an order callback. It seems that the SetOrder is simply ignored.

  • You must to post comments
0
0

Thanks! Now I’ve gotten it to work, but I have a question. Why is it always called in pairs? If I call FMUSIC_SetOrder from within the first call of the pair, it is ignored.

But anyway, that was easily worked around once I figured out what was going on, so … interactive music, here I come! ๐Ÿ˜€

  • You must to post comments
0
0

Odd, I put a printf in the callback, and I get pairs on every callback. Below is my test program:
[code:2vg28ybi]

include <stdio.h>

include <allegro.h>

include <fmodinc/fmod.h>

int doIt;

void MyCallback(FMUSIC_MODULE *mod, unsigned char param) {
static long c=0;
static char buf[80];
c += 10;
if (doIt) {
if (doIt == 1)
doIt = 2;
else {
doIt = 0;
}
FMUSIC_SetOrder(mod, 0);
textout(screen, font, "Jumped.",0 ,c , makecol(255,255,255));
}
sprintf(buf, "%d", param);
textout(screen, font, buf,100 ,c , makecol(255,255,255));
}

int main(int argc, char *argv[])
{
int i;
FMUSIC_MODULE *song;

allegro_init();

install_keyboard();

set_color_depth(8);
if (set_gfx_mode(GFX_AUTODETECT, 640, 480, 0, 0)) {
    allegro_message(allegro_error);
    allegro_exit();
    exit(1);
}

i = FSOUND_Init(32000, 64, 0x80);

song = FMUSIC_LoadSong("C:\Program\SLUDGE\Development Kit\Projects\Mathias\Bar\Bar.it");
i = FMUSIC_PlaySong(song);

FMUSIC_SetOrderCallback(song, MyCallback, 1);
doIt=0;
do {
    if(key[KEY_SPACE]) doIt = 1;
    if(key[KEY_ENTER]) FMUSIC_SetOrder(song, 0);
} while (!key[KEY_ESC]);

i = FMUSIC_FreeSong(song);
FSOUND_Close();

allegro_exit();
exit(0);

}
[/code:2vg28ybi]

It always shows double calls. Am I doing something wrong?

  • You must to post comments
0
0

I have tried it with two different files, with the same result. Here they are:
[url:2txff7kr]http://www.trumgottist.com/tmp/bar.it[/url:2txff7kr]
[url:2txff7kr]http://www.trumgottist.com/tmp/burbon.it[/url:2txff7kr]

  • You must to post comments
0
0

And indeed it does work perfectly. Thanks a lot!

  • You must to post comments
Showing 10 results
Your Answer

Please first to submit.