Matching BPM
Blitz3D Forums/Blitz3D Programming/Matching BPM
| ||
Hi guys, i wanted to make a game which would enable the users input actions to match with the tune (note perfect), similar to the DDR series. Can anyone possible show me a simple piece of code to demonstrate this please, just to get me started? DDR ScreenShot: Thanks guys ICE |
| ||
I don't think that's possible in blitz without a dll or something. Sound support in blitz is pretty, well, basic :) |
| ||
- Find out the BPM of the tune (you can get software that will do this - often by tapping the spacebar to the beat) - Turn this into a millisecs value bpm/60/1000 = number of beats per millisec - Keep a constant record of how many millisecs have passed since the VERY first BEAT of the song. - Program a script for each song something like : 16423 millisecs = up arrow 37446 millisecs = 'D' button - As each event passes, based on a threshold value decide if the user pushed the button in time - this would also allow you to get 'perfect' presses (if abs(cuurent_millisecs-time_from_script)<10 then you_have_pressed_the_button_within_10_millisecs_of_the_correct_time() Using this method you can also get quarter-notes / eigth notes (crotchets and quavers) to make the game harder. :) |
| ||
DDR ? hm (lol) use skitchy's methode or the bass dll ! |
| ||
If I understand him right that's not what he wants, guys. He wants to know the note of a tune and someone should hit the right key. BLUE, you could use a mod-file - load it into a string and find out, where the data-set for the tune begins - the format is something like note, length of note, Flags, etc for each note - and this for each channel. To find that out, use a soundtracker or such, and compose a song using this line: c d e f g a b c - load the mod-file into a string(!) or bank and check the values you imported. You will find the c d e f g ... Once you know how a tracker saves the values - you can easily use that (load the trackersong as mod and parallel into a string or bank), and run a timer that tracks the keyinputs and compare with that song. |
| ||
Thanks guys for all your help. Kournikov, thanks for the advice i will attempt to try with the soundtracker method. Once again, thanks guy for all your kind help BLUE :) |