   Rhythm game BPM?
  Lets take a song with 200BPM. It is 2 beats p/second, and if it is running at 60fps, that would be one every 30 frames. What I need is a way of moving the "notes" at the same rate as the song, this code works at the start, but then gets out of sync later on with the song.(pseudo-code)z-position = oldZposition-((BPM/60)/FPS)*BPMcould I possibly have a little help with the code?   
  Your problem is your assuming the humans making the music kept EXACTLY 200Bpm. Which is possible if its computer generated, but the artist will have breaks, solos and other things which can throw off the BPM.What you need is to detect BPM's and sync the notes to BPM. There's actually a wonderful and amazing resource right here on the site I've used.http://www.gamedev.net/reference/programming/features/beatdetection/Looking at the math, I'm not sure if I could completely recall how to implement it, but it shouldn't be hard.   ;  You should also not assume that the frame rate will be constant. Ideally you want the note position updates to be completely seperate from the frame drawing system. If your note updates are based on FPS, and it suddenly drops for whatever reason, the notes will go out of sync with the music anyway.   ;Quote:Original post by prasocLets take a song with 200BPM. It is 2 beats p/second, and if it is running at 60fps, that would be one every 30 frames. What I need is a way of moving the "notes" at the same rate as the song, this code works at the start, but then gets out of sync later on with the song.(pseudo-code)z-position = oldZposition-((BPM/60)/FPS)*BPMcould I possibly have a little help with the code?Firstly 200 BPM = 3.3333333333 beats per second. 120 BPM is 2 beats per second.One simple improvement to that calculation would be to use floating point maths:z-position = oldZposition-((BPM/60.0f)/FPS)*BPMHowever, instead of that I'd suggest working the position out based on the elapsed time since you started the audio, as the frame rate is very rarely constant.z-position = initialZ - (((currentTime - startTime) / (float)timerFrequency) * pixelsPerSecondScrollSpeed);;  Ok. I've mostly worked it out now, albeit the movement is quite jerky (any ideas?)move = (192/(bpm/60))/(bpm/60);if(dbAbs(currTime-startTime) > bpm/60){camera z-pos += move}