Skip to content

Increasing clock precision #257

@giohappy

Description

@giohappy

Testing the MIDI Clock with Reaper and Bitwig I've noticed that it has jitters and it's slightly offest. E.g. 110 bpm results in values jumping around 110.3/110.4 inside the DAWs.
This is expected when setInterval is used, even if the main clock ticks inside a WebWorker.

Have you ever considered a solution where the clock ticks on the base of time measured with performance.now()?
A setInterval callback might be set to run, let's say, every 5ms, but a time "integrator" could use performance time to decide when a tick should actually trigger.

From my tests (with an infinite loop in my case) using performance to decide when to send the MIDI clock pulses I can get a stable and reliable bpm in my DAWs.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions