Tracktion / tracktion_engine

Tracktion Engine module
Other
1.2k stars 152 forks source link

Fix for misplaced click emphasis of firstBeatOfBar #152

Closed splintersilk closed 4 months ago

splintersilk commented 1 year ago

Summary: Changed bool isFirstBeatOfBar from beatTime getWholeBeats() to beat with a modulus of the time signature numerator.

Reasoning: Periodically I observed the click emphasis on the first beat of a bar being misplaced. ie. the second beat or last beat of a bar were emphasised instead of the expected first beat.

The issue seems to originate from getWholeBeats() not being equal to 0 when expected.

In general this issue presented more often with bpm values with lots of decimal places. eg 157.1396273744468 at 4/4 timing.

As of now I have not managed to reproduce the same problem in testing my adjusted code.

drowaudio commented 1 year ago

Can you provide a bit more info on why it was failing? What was the value of getWholeBeats() when the problem occurred?

Also, are you able to provide a failing test case? I'd like to add this to catch any potential regressions in the future. Cheers!

drowaudio commented 4 months ago

I think this has been fixed on the feature/launcher branch as a side effect of some other changes. If you still manage to see it, can you reopen this or open a new issue please? Thanks.