How to start my Rhythm game ?

  1. In a rhythm game, have a class that is used solely for keeping the beat.
    In my games I call it the Conductor. It should have an easy function/variable that gives the song position, to be used by everything that needs to be synced to the beat. In this game for example, the Conductor has a variable called songposition which is pretty much the cornerstone of everything in the game.

http://www.ludumdare.com/compo/wp-content/uploads/2014/09/Screen-Shot-2014-09-04-at-23.21.48-550x219.png

The above are the variables in the Conductor class. Some are specific to my game, but the general ones that I always have are

bpm, which gives the bpm of the song
crotchet, which gives the time duration of a beat, calculated from the bpm
offset, always important due to the fact that MP3s always have a teeny gap at the very beginning, no matter what you do, which is used for metadata (artist name, song name, etc)
songposition, a variable that should be set directly from the corresponding variable on the Audio object. This varies from engine to engine, but in Unity for example, the variable to use is AudioSettings.dspTime. What I do is, in the same frame that I play the song, I record the dspTime at that moment, so then my song position variable is set on every frame as follows:
songposition = (float)(AudioSettings.dspTime – dsptimesong) * song.pitch – offset;

Aside: the song.pitch is an inbuilt variable in Unity that gives the speed the song is playing at. By incorporating it into my song position variable, I can change the playback speed and still keep everything in sync. This was used in my game to slow all the songs down 20% because I only realised after composing the music that it was too difficult.

Anyway, now that we have set up our Conductor, time to take care of the objects that need to sync to it!

I just found this online, but how would I convert this into lua code

http://ludumdare.com/compo/2014/09/09/an-ld48-rhythm-game-part-2/

The ABCmusic player is in the CargoBot example. See what songs you can find online in ABCmusic format, add them to the ABCmusic player, and see what flies!

maybe what i say is unnecessary?is there a way similar with editing lrc?

@goatboy76 could you show me some starting off code to detect user input for beats of a song instead of rhythm, and maybe that could kickstart my project in the simpler direction instead of using rhythm?

Can anyone tell me how to make the game work using

elapsed time