Music?

Started by
15 comments, last by Marty15 21 years, 11 months ago
I don''t think so, but I could be wrong. It''s been awhile since I worked with DS, but it should go something like this:

Read samples from the wave file
Send them to DS
Send them to the FFT
Get frequencies back -> do something
repeat

make sure you keep DS well fed, otherwise you''ll hear skips in your audio.
Author, "Real Time Rendering Tricks and Techniques in DirectX", "Focus on Curves and Surfaces", A third book on advanced lighting and materials
Advertisement
[If you're reading this "kalolsemon" I would suggest you read my response a little farther down -Michalson]

[edited by - michalson on June 8, 2002 4:06:32 PM]
Woah, woah, woah, WOAH!

I mean, all of these would technically work, but the first question should have been: Are you allowing user-imported songs?

If yes, then these more complex techniques are totally necessary- ignore me.

If not, why wouldn''t you just markup each song/level with the BPM by figuring it out beforehand? You could even get schnazzier and mark the section changes/beat structure etc. in some fashion. . . in any case, this takes almost no time at all. (give me 15 seconds and I can approximate the bpm of any dance song within a couple beats. . . two minutes and I''ll give you a 100% accurate figure)

You guys are making this more complicated than it is, I think. No need to spread the computational muscle thin if it can be precomputed.

If you see the Buddha on the road, Kill Him. -apocryphal
If you see the Buddha on the road, Kill Him. -apocryphal
this is true, but just figuring out the b.p.m. greatly increases the chance that everything could get out of sync. yes, you could get palm trees to sway at 110 b.p.m., but all in all, would they dance with the music, or only with the tempo, but not on the actual beat? With FFT, you can analyze exactly when a beat is occurring and then have your program act accordingly. If you wanna do it right, do it right. if you just wanna make the game, you could do that too. From what it sounds like, though, this is a pretty integral part of the game, and I would wanna do it right.
quote:Original post by kalolsemon
hi dude

i found kazaa best music share pogramm and i think u find your music there.


Since all your email addresses are just fly by night hotmail accounts I''ll have to post this here and hope you see it (your loss if you don''t).

Stop creating accounts and posting kazaa spam. Your other thread was closed for a reason. This is not even a related discussion. If you do not stop creating fake accounts to spam with you will simply be banned, including the 2 semi-legimate accounts you created to post answers in other threads.
Assuming you work with a PCM wave (wav, mp3 after decompression, etc):

In my opinion, your better option is pre-mark the music, you can do a program that plays and mark the beats pressing the spacebar. Calculating only the BPM and the first beat is incorrect since it is possible that some songs have little variations in time (not most dance music, however).

Calculating beats in realtime is impossible. The best you can get is something like winamp or other plugins do. You can apply a FFT but the resolution in realtime is not enough. I''ve worked with this last year for my Data Transmision Subject.

Actually, computers can''t handle sounds and distinguish anything with a little of acuracy. Plus, some songs mark the beats not with drums, but with bass and other instruments which make a funcional analisys impossible (well, maybe one day... but this is not an issue for a game).

I would premark all the beats and maybe some other information (crescendos, little stops, etc.). You can always add more songs later.

Real programers are not afraid from maths! (but I am)
JJpRiVaTe (Private Zone)
-=[ J ]=-I always forget to change the tagline.
Thanks thats what i have decided to do.

I have an .ini file to mark the beats of each song because i couldnt do anything with FFT, but at least i know what it is now.

Thanks to everyone who replyed.

This topic is closed to new replies.

Advertisement