Description
Issue
Cubase tempo tracks can contain one or more jump or ramp tempo events. A jump is an immediate jump to a new tempo. A ramp is a gradual ramp between two tempo events.
Currently, DAWFileKit can accurately determine event start times (and timecodes) when "jump" tempo events are used exclusively. However, DAWFileKit cannot yet properly calculate event start times if one or more "ramp" tempo events are used. The time calculation that Cubase uses needs to be intuited.
Observations
The ramp is linear when in the musical domain (bars + beats). However this results in a curved ramp when in the real time domain.
For consideration, this is a Cubase project used in DAWFileKit unit tests (after being exported as a Track Archive XML file). The ramp curves can be observed in Cubase by changing the visible time scaling mode.
Current Progress
The unit test involving the Cubase project shown above is already written, but the four marker events that overlap and trail the tempo ramps have been commented out, as they will fail currently since the calculations are not yet correct.
The currently incomplete calculation is found here:
DAWFileKit/Sources/DAWFileKit/Cubase/TrackArchive/TrackArchive Helpers.swift
Lines 118 to 123 in dbd6a1d