Synching FX with music
category: general [glöplog]
I'm using FMOD to play the music(mp3 format) and I'd like to synch some effects with it.
Does anybody have a link to a tutorial that explains the basics.
Thanks
Does anybody have a link to a tutorial that explains the basics.
Thanks
I think FSOUND_DSP_getSpectrum will give me what I need.
duffman: syncing on spectrums alone is a bad idea, as they are quite unstable and unpredictable. coding proper beat-detection etc is really difficult. i suggest using skrebbels sync-tracker! oh, wait! you may not have access to that wonderful tool! too bad, sucker! 4h4hh4h4h4h4!
Duffman: I did not have a look at FSOUND_DSP_getSpectrum but I guess it's the usual FFT stuff, which alone is not very good as kusma already mentioned it. At best your effects will look like those 90's trancey demos seen 50 times.
Try to implement some timeline based sync with events YOU define and initiate for given time indexes (along with some spectrum analysis driven events)
Try to implement some timeline based sync with events YOU define and initiate for given time indexes (along with some spectrum analysis driven events)
It's not that hard to figure what/how to do it. Learn some music theory... :D
some function like that:
might be helpful
Code:
U32 CTimeline::QuarterBeatToMillisecs(U32 qb)
{
return (U32)(((F32)qb)*((60000.f)/(((F32)f32BPM*4))));
}
might be helpful
My suggestion is to avoid FMod's timing functions, they tend to be less-than accurate. Use timeGetTime() or something similar and code a quick time-line tool instead. It's not that time consuming, and it really pays off.
Oh, and also; mp3 playback tends to be a bit laggy on FMods sometimes, so you should use OGG instead. :p
Oh, and also; mp3 playback tends to be a bit laggy on FMods sometimes, so you should use OGG instead. :p