I’m working on a little arpeggiator. As is pretty typical (I think), the duration of each note is represented as some number of samples. For example, if the arpeggiator is playing one note per beat at 130 bpm with a sample rate of 44100, the number of samples per note works out to be 20353.84. Of course fractional samples make no sense, so this has to be rounded to be an integer. By rounding, you’re losing a tiny bit of a accuracy. Not a big deal in most cases. Still, it bothers me because this minuscule amount of inaccuracy compounds with each note. After some (admittedly crazy large) number of notes, the gradual drift off-tempo will become noticeable.
Is this just the nature of using samples to represent a duration of time? Are there any techniques to offset the compounding inaccuracy?