Hi there,

I'm trying to write a metronome for my brother (who is a drummer). He tried a few that was downloadable but want's to have a custom one according to his specs...

Now i only have 1-2 months of C# programming experience (1 month for the following each aswell: VB, C++ and Java). My problem is that i want the sound ticking (keeping the beat) to happen on a certain interval. My thoughts to solving this was to use the built in timer but it only takes Int32 values as it's interval. In orther words if i have 60000 milliseconds (1 min) and wanted to have a beat of 175 p/m then 60000/175 = 342.85714285714285714285714285714.

I can't round of this number cause then the beat will eventually go off... Am i thingking of the best solution here or not?

Any advice will be appreciated! Tnx in advance!

I found a good article here(see the QPC section). Windows has a certain amount of wiggle room between interrupts lowering the precision of the timing (I don't know much beyond that) and this is why people turn to embedded and real time solutions.

Why bother?
If your brother drums during 10 min at 175 beats/min:sweat: your metronome will be off by a mere 8.57... ms.
Besides music is not governed, by a metronome alone!
It is just an aid to help beginning musicians to keep the rhythm.
But hear the difference between a live drummer and a drum machine. A live drummer, by bringing small variations into his rhythm will make his music come alive, a drum machine, well... it is a machine...
Also look up the musical term rubato on wiki.
Succes with your project.