Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Finding the beat in a song for a rhythm game

Author
Message
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 27th Aug 2016 23:46
Any ideas on finding the beat of a song? For a rhythm based game
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 28th Aug 2016 15:25
In c++ it'll be easy with an additional audio library like fmod. In agk alone you'll need the raw audio data and run it through a Fourier transform; Fast Fourier transform (FFT)

I believe it's been done in dbp.

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds
SoftMotion3D
AGK Developer
18
Years of Service
User Offline
Joined: 24th Aug 2005
Location: Calgary,Alberta
Posted: 28th Aug 2016 16:43 Edited at: 28th Aug 2016 16:45
or.... process the music manually. I would setup a save file where you are playing the song back and manualy save the beat points with key presses on the keyboard and do this for each song. Then when the song plays back for the game it will know the time intervals and show some graphic too when the notes are gunna hit. In this save file it just needs to know what beats are next and distance from song start.

best option i think for a rhythm game.

the only downside.... it cant do custom music unless they create a beats file of some sort for your game to understand. Have another utility program so people can add music for the game maybe?
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 28th Aug 2016 21:38
ok thanks guys. couple of options there that are very helpful
Battoad
AGK Developer
17
Years of Service
User Offline
Joined: 12th Feb 2007
Location: A Dark Place
Posted: 31st Aug 2016 12:44 Edited at: 31st Aug 2016 15:26
I think that there is enough support/requests for more sound/music commands for tier 1 to justify the extension of support to this area.

The only variant we have at the moment is to set volume, whereas adjusting frequency and/or wavelength, detecting & adjusting beat/rhythm, adding/subtracting harmonics and simulating transmittal through different environments and mediums other than air could open up a whole new area for developers in tier 1.

Any other ideas should be listed for Paul to at least consider.

Thanks.
CJB
Valued Member
20
Years of Service
User Offline
Joined: 10th Feb 2004
Location: Essex, UK
Posted: 1st Sep 2016 10:07
Built in 3d sounds would be good. Nothing too fancy, just fade / pan based on location in 3d world. for exaple: SetSoundPosition(SoundID, x, y, z).

V2 T1 (Mostly)
Phone Tap!
Uzmadesign
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 1st Sep 2016 11:03
In DBPro there is an example using the fmod.dll - shows a neat UV bar thing and all that complex data - but you'd still have to calculate everything. To me that seems impractical, it's not how games like Guitar Hero and RockBand do things - they use midi files.

So, I'd suggest having a timeline array and doing it manually, the long and tedious way, but compared to what is involved in analysing audio to this extent.... well do you really want to spend months messing around with that, or a few days with your own editor. I'd work out the BPM and get the song aligning to a simple grid, have it so you can record while the song plays, then edit, and test it thoroughly. I think that's a much saner way to spend your time, and it's something that you can get stuck into right away.

It's what they do for Rock Band, some poor sod sits with a midi keyboard and listens to the song, hammering out the responding notes for the guitar or drums. This is much closer to the music experience than Audiosurf - that is more interested in presenting a challenge and flowing with the music, working out the BPM as it goes to link that to the vehicle speed. I like both games, but I'd only bother attempting a Rock Band style music game, with manually edited beats.
The code is dark and full of errors
blink0k
Moderator
11
Years of Service
User Offline
Joined: 22nd Feb 2013
Location: the land of oz
Posted: 1st Sep 2016 23:08
Thanks a lot guys! Manual beat detection it is

Login to post a reply

Server time is: 2024-04-26 03:16:01
Your offset time is: 2024-04-26 03:16:01