Skip to content

All time math should be based on samples, not TimeInstants #7

@kirbysayshi

Description

@kirbysayshi

There are several places where rounding errors make for tricky code and bugs. Ideally:

  • all feed calls accept a sampleIndex: number instead of renderTime: TimeInstant
  • TimeInstant can still be used for the external api, and when it makes sense to convert from Score values
  • Add a SampleTime.fromNanos(nanos:number, hz: number): number conversion utility to avoid instantiating so many TimeInstants.

TimeInstants are really useful for reading values from Scores, but should not be used as the base unit for sample math.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions