MidiReceivedEventArgs has Timestamp property, and IMidiInput is supposed to provide timestamps, if sent by the input devices, or the device should give it. However, there is no common ground on how those timestamps are given.
It is most likely a timestamp value is an absolute value within a process, but it is relative to something like app start time (e.g. Web MIDI API uses DOMHighResTimestamp of "time origin" i.e. the created time of the "global object" which is either a Window or a WorkerGlobalScope). To follow that, what we could do here is probably to use the actual time of message creation, subtracted by the "time origin" of IMidiAccess object, which may come from either externals or the instantiation time of it.
MidiReceivedEventArgs has
Timestamp
property, and IMidiInput is supposed to provide timestamps, if sent by the input devices, or the device should give it. However, there is no common ground on how those timestamps are given.It is most likely a timestamp value is an absolute value within a process, but it is relative to something like app start time (e.g. Web MIDI API uses DOMHighResTimestamp of "time origin" i.e. the created time of the "global object" which is either a
Window
or aWorkerGlobalScope
). To follow that, what we could do here is probably to use the actual time of message creation, subtracted by the "time origin" of IMidiAccess object, which may come from either externals or the instantiation time of it.