Calculate accurate time value from tick count in a plugin?
I am developing tools that help automate aspects of my workflow, which comprises arrangement in MuseScore and recording in other programs (currently Audition) with the MuseScore recording as a backing track. I am quite new to MuseScore plugin development, but a decently experienced programmer. In any case, this automation would ideally include creating markers at each rehearsal marking, but as Audition lacks a sufficient notion of tempo/measures for this job, that requires calculating a time for each rehearsal marking (note that many if not most pieces involve tempo changes, and I'd like the system to be robust in that respect).
Currently my thought process for how to do this (as of yet unimplemented) is to iterate through each Segment (https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/class… - linked in case I'm misunderstanding) and get the rehearsal marks from there. Then, I can get tick values for each rehearsal mark, which leaves only the conversion from tick to time. I googled around to see if this had been tackled before, but found only this (https://musescore.org/en/node/84886), which I can only assume is for either the 1.x/2.x interface or some form of internal development, as I can find no reference to it.
Unfortunately, all of this still leaves that conversion from tick to time. My only thought for how to do this is to walk the score with a Cursor (perhaps with some advance mode like these [https://musescore.github.io/MuseScore_PluginAPI_Docs/plugins/html/names…] that only advances to tempo changes?) and manually calculate the time-wise distance using ticks, the division setting, and that scraped tempo information.
However, this seems incredibly convoluted, so my question (and apologies for the bad forum practice, as this is somewhat of a "how-do-I-do-this" question) is if there's any better way to do this conversion? Or perhaps some way to avoid it entirely? MuseScore clearly calculates these things internally, such as in the play panel, so I'm hoping I've missed some easy solution.
Thanks in advance for any help!