Here's a question from an amature coder.
I was trying to make a little sequencer to play some wave samples,and i wrote some lines of code to calculate timer interval [in miliseconds] by a given tempo in BPM.
I figured out that 120 beats will be 1 minute [60000 miliseconds] so interval for a given tempo would be:
interval=(60000/tempo] 'in miliseconds
it seemd to work fine and i could get 1/4,1/8 and 1/16 intervals for a timer which was playing a sample.but when i compared my output with some other sequencers playing a click track,i found out that what i'm hearing in my program is a bit slower than standrad tempo.cakewalk was playing a click in 120BPM but mine was playing slower even it seemd to be running at 120bpm.
am i awefully wrong? does anybody knows the formula to calculate timer interval by a given BPM?
thanx.