-
Notifications
You must be signed in to change notification settings - Fork 13
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
Timestamp precision #11
Comments
In portmidi.h, this: /*
PmTimestamp is used to represent a millisecond clock with arbitrary
start time. The type is used for all MIDI timestampes and clocks.
*/
typedef long PmTimestamp; would then be replaced by: /*
PmTimestamp is used to represent a nanosecond clock with arbitrary
start time. The type is used for all MIDI timestampes and clocks.
*/
typedef unsigned long long PmTimestamp; |
For alsa, |
Platform dependent behaviors are tricky to implement or test. But if you think the change is worth the effort, I've no problem with added precision. |
Initially I was ready to do the implementation, but now, I think I can live with a millisecond precision :) |
The
Timestamp
(type Timestamp = CULong
) precision is currently milliseconds, which is enough to introduce midi-jitter of up-to one millisecond. I guess that in some applications, it could be audible, and some platforms (OSX for example) provide nanosecond precision for MIDI timestamps, so we could rewrite portmidi to take advantage of the full resolution, where it is available.I'd like to propose a PR where the full precision is kept.(After looking at it a bit more, it looks like it's a big task... and we would need some unit tests to make sure nothing is broken.)
Since it's a breaking change, to avoid undetected bugs when upgrading, I think the type should be changed, I propose
newtype NanoTimestamp = CULLong
.What do you think?
The text was updated successfully, but these errors were encountered: