project.bpm does not return Master_GetTempo as documented
Opened this issue · 2 comments
Line 1945 in 14c8d88
In the documentation it is stated that project.bpm is mapped to the Reascript-function Master_GetTempo(). But they only return the same result if you have no tempo changes within the project.
While Master_GetTempo() returns the current tempo at the cursor position within the reaper-project (I verified this with a project containing a tempo change), project.bpm aquires its result via the method GetProjectTimeSignature2, which seemingly returns only the tempo at the beginning of the project.
So if you want to display the current BPM at the given time, the project.bpm method will not help you.
This can either be a bug (method is not working as documented) or a new feature request (request tempo at cursor position).
I am looking forward to discussing this and/or contributing a pull request with the changes
Hi @IngoHenkel, well spotted thanks! I think it makes sense that Project.bpm
would return the base project tempo while another method would return the tempo at cursor position. So as you said it's both a documentation error and a missing feature.
Pull requests are very welcome, but I have to warn you that there currently is a substantial backlog of unmerged PR that I have to process, so it may take time before I review yours. In the meantime, feel free to ask any question you may have regarding contributing.
I guess the implementation itself is gonna be straightforward so the question that remains is where to place this feature in the API. My first idea would be a Project.bpm_at_cursor
property. Anything better coming to your mind?
HI @RomeoDespres , that was actually exactly what I was thinking. This way you ensure legacy support and also the new function basically makes clear what its returning by its name.