reaper-oss / sws

The SWS extension is a collection of features that seamlessly integrate into REAPER, the Digital Audio Workstation (DAW) software by Cockos, Inc
https://www.sws-extension.org/
MIT License
449 stars 85 forks source link

Action 'Move closest gridline to mouse cursor' does not work with time signature marker without tempo information #1737

Open Hipox opened 1 year ago

Hipox commented 1 year ago

Hello, I have a problem with the behaviour of action: 'SWS/BR: Move closest grid line to mouse cursor (perform until shortcut released)' .

In case I insert just 'time signature marker' without tempo information in the marker, I get weird behaviour like on the attached gif. bug tempo signature marker sws action

I would expect the time signature marker to not interfere with tempo markers, probably just ignore them while using this action?

Thank you for great work! Peter

frenchy64 commented 1 year ago

It looks like if the previous point does not set a BPM, then updating its BPM does nothing.

Perhaps this line needs to be more discerning about which point to choose (presumably the previous point that actually sets a tempo).

If we do that, there's another corner case that might need handling here to ensure there's always a point in the tempo envelope that actually sets tempo.

frenchy64 commented 1 year ago

I couldn't find a way to determine whether a tempo envelope point explicitly sets a BPM, so perhaps the only fix would be to add a bpm to the time signature and use that as an anchor.

I was able to handle the case where the very first point is a time signature by simply providing its BPM in InitTempoMap(). However, I haven't had any luck doing similar things for subsequent points like in the original report.

frenchy64 commented 1 year ago

I think I found a fix, unclear if it's a good idea but here it is: https://github.com/reaper-oss/sws/pull/1738

frenchy64 commented 1 year ago

Try the action Set default mouse modifier action for "Project tempo/time signature marker left drag" to "Move project tempo/time signature marker, adjusting previous and current tempo", it seems to do what you want.

Make sure the timebase for tempo markers is set to Beats, otherwise it won't work.