Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Higher resolution timestamps #359

Open
olofson opened this issue Oct 26, 2022 · 0 comments
Open

Higher resolution timestamps #359

olofson opened this issue Oct 26, 2022 · 0 comments
Labels
enhancement Minor features, and improvements on existing functionality refactor Redesign of code without significant changes in functionality

Comments

@olofson
Copy link
Owner

olofson commented Oct 26, 2022

Given that even phones have 64 bit CPUs at this point, it might be time to switch to 64 bit timestamps, with higher sub-sample resolution. A 48:16 timestamp format would have a number of advantages over the current 24:8 format:

  • Wrapping at 192 kHz would occur after 46 years, as opposed to every 87 seconds, so we can just ignore that, meaning...
    • No special care (macros) needed for timestamp arithmetic and comparisons
    • Long delays (event scheduling, envelope times etc) will no longer be problematic
  • Accuracy should be enough for implementing granular/BLIT oscillators with no audible artifacts due to timing errors
  • 64 bits is plenty of space for alternative timestamp formats, such as measure:beat:tick, SMPTE etc, perhaps with the format encoded in the high bits
    • On the downside, that would of course reintroduce the need for special care when comparing and operating on timestamps

Other formats may be of interest, for a bit of extra resolution, but the wrap time quickly becomes a real issue;

  • 32:32 wraps ever 6.2 hours, which is problematic in common applications
  • 40:24 wraps every 66 days, which would be a problem in embedded systems, arcade games and the like
@olofson olofson added enhancement Minor features, and improvements on existing functionality refactor Redesign of code without significant changes in functionality labels Oct 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Minor features, and improvements on existing functionality refactor Redesign of code without significant changes in functionality
Projects
None yet
Development

No branches or pull requests

1 participant