2020-04-04 13:03:22

Hi all, as the title says, how would i go to make a BPM calculator based on key presses in python? I tried to think this through multiple times, but i don't find a solution. the only thing i know is to devide some kind of value by 60 since it is a minute. please help if possible!

best regards
never give up on what ever you are doing.

2020-04-04 13:59:21

amount of keys pressed / 60

If you like what I do, Feel free to check me out on GitHub, or follow me on Twitter

2020-04-04 14:46:57

Hi there, i don't think that method will work, because if i will then press 10 keys, no matter what the timing is, it will only give me 1...

best regards
never give up on what ever you are doing.

2020-04-04 15:03:21

You need to have a list tracking the times when the user pressed a key and calculate the average after a minute is up.
Alternatively, you can change it to break out of the loop on a certain amount of keypresses have been reached. You can also make it more advanced by dropping the keys pressed if they are above a certain time range.