Currently the metronome is out of sync. This issue is clearly audible. Especially with a high tempo and lot of subdivisions.
This is because of the standard Timer class. The scheduled task is often 10ms or more behind the actual planned execution.
When scheduling ticks with a typical Thread-sleep mechanism the precision will probably never be good enough to sort out this issue.
Instead we should investigate an approach that writes the audio data in before to an AudioTrack so it gets played exactly in time.
Currently the metronome is out of sync. This issue is clearly audible. Especially with a high tempo and lot of subdivisions. This is because of the standard Timer class. The scheduled task is often 10ms or more behind the actual planned execution.
When scheduling ticks with a typical Thread-sleep mechanism the precision will probably never be good enough to sort out this issue. Instead we should investigate an approach that writes the audio data in before to an AudioTrack so it gets played exactly in time.