I desperately need help figuring out this mathematical conundrum. I've never been good at math so I'm pretty much fried. I'm trying to create a metronome in Game Maker (I have reasons) and GM is sadly so screwed up you have to bust your brain to figure everything out. I've discovered that the perfect second in the alarm system is a delay of 30 between each alarm. Now, to calculate the delay time of a tempo beat is simple because there are 60 seconds in a minute, and 1000 milliseconds in a second, so that's 60 * 1000, which totals 60000. Fair enough. All I really need is to sort out how to calculate a proper timing mechanism to get all of this sorted out. Since I'm dumb in math I could only think of this:
Uh why don't you just do this?
Create:Because that would only work for a tempo of 120. If I wanted to change it to 240 then that wouldn't help.
So multiply room_speed by 2?
Yeah, no, that doesn't work. Let's pretend the room_speed variable doesn't exist.
Well if you're just trying to play a sound every second or a period of time relative to a second, it should work. You just have to find what you have to divide/multiply by.
TempoWanted=240;AlarmSpd=(60/TempoWanted)*room_speed;Should work O_OIf you don't want room_speed, there's a few precise time dlls on GMC.
True, but the only reason I'm trying to figure this is just in case I want to migrate out of GML for another language. I can tap out the screwed up timing in the alarm system myself if I decide that, but I'm just trying to figure out this formula XD.
if you moved away from GM you'd have access to real timing. Stop using GM if you want to stop using GM. It's meant for making games, not language-agnostic algorithms.
I'm not intending on giving up GM at the moment, just pissed at not being able to figure out this algorithm. It's relating to a game I'm working on, which involves a metronome and I want it to be correct, and I'm going to use a precise timing DLL but I still need to figure this out. So, stop running around in circles and help me if you can. Otherwise, no comment.
ooh la la. You're using GM, you don't get to be picky with your coding. Either use built in functions, or use a timing dll, there is no middle ground, so don't shout at me because you want one.