jPCT-AE - a 3d engine for Android => Projects => Topic started by: Starfight on April 07, 2013, 12:01:24 am

Title: Music Game: Sound of Infinity
Post by: Starfight on April 07, 2013, 12:01:24 am
This game is in progress. Sorry for my bad english, I'm french.


This is my first project on Android. My aim is to create a game which is etablished depending on a song.
I know it's not a revolutionary idea but I think it's a good start. My inspiration come from Audiosurf, Supersonic HD and Music Ride (a game using jPCT-AE).
It's a project for my ingineering school ENSC at Bordeaux, France.
The game's name is inspired from a F-777's song.

Using jPCT-AE

I use jPCT-AE for create a random tube where a spaceship come from one side to the other collecting bonus (light blue sphere) placed depending on the notes of the song.
I analyse the song with a FFT previously for detecting the notes.
The tube is created in the application
The spaceship and its texture are imported from a 3DS file.

Currents problems

At the moment the application work without problem.
The only lack is the optimisation. In fact, my game running with approximatively 45-50 FPS, what is not too bad but not perfect too.
I don't know is it's due to the number of 3D objects or the move's computations.

Some Screenshots


Thanks for watching.
Title: Re: Music Game: Sound of Infinity
Post by: zbych on April 14, 2013, 09:09:37 pm
Sounds interesting. You are "detecting" notes or rythm? What kind of algorithm do you use, or you have separated file with precalculated beat/note data?
I am asking because I was trying diffrent kind of beat detection algorithms and my results weren't as good as in Audiosurf.
Title: Re: Music Game: Sound of Infinity
Post by: Starfight on April 16, 2013, 03:35:56 pm
I'm "detecting" the difference between 2 temporal windows.
I take a part of the temporal signal and I do a FFT. After I keep the most important frequencies using a threshold. The threshold is arbitrary (but it's not a good solution).
To calculate the difference between two temporal windows, I do a ratio between the same frequencies keeped and the total number of frequencies used.
It's not a great method, because I'm using a first order filter.

When I searching a method, I have seen this algorithm in C++ for a beat detector : http://files.codes-sources.com/fichier.aspx?id=53536&f=Beat+Detector%2fBeatDetector.cpp (it's a french source code)
Title: Re: Music Game: Sound of Infinity
Post by: zbych on April 18, 2013, 09:09:36 pm
I made similar approach to this one in your link. However I did not look forward and backward to find beat in time distance (it is helpful if you want to find exact rate/tempo or speed changes). In my solution I first calculate FFT, and try to find power peaks on few selected frequence ranges, in that case I am able to detect "beats" of different "instruments", and I use variance calculation to correct the "energy ratio". I used C to implement this because C++ is not recommended in NDK (C++ is not fully supported).
I am using average power values to create base shape of track.
One more question: how do you get decoded data, I am using lame and ogg sources to create decoder (it tooks me a lot of time to compile and make lame to work :/ the ogg is a lot easier to use), do you have another solution?