Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that tracks with an invalid bpm are re-analyzed #2776

Merged
merged 2 commits into from
May 16, 2020
Merged

Ensure that tracks with an invalid bpm are re-analyzed #2776

merged 2 commits into from
May 16, 2020

Conversation

uklotzde
Copy link
Contributor

@uklotzde uklotzde commented May 10, 2020

I didn't want to publish these changes to avoid breaking the analysis again. But this change could fix the issues that occurred when resetting the bpm while the database column update (fixed in #2773) was missing.

By removing the nested if-else blocks the code is now hopefully easier to follow.

@Be-ing
Copy link
Contributor

Be-ing commented May 10, 2020

Something is quite bizarre with my database. I cleared the BPM and beatgrid of tracks via the track context menu that had no BPM detected before. With this branch, when I load them to a deck, they analyze, but every track is detected as 129.3 BPM... I cannot reproduce these issues with a fresh database.

if (!pBeats) {
return true;
}
if (!mixxx::Bpm::isValidValue(pBeats->getBpm())) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a logical change. Bpm::isValidValue checks if the BPM is < 0. The old code checks if the BPM == 0. Do we want <= 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, that's correct. It checks for value > kValueMin = 0.0, i.e. re-analyze if bpm <= 0.

@daschuer
Copy link
Member

I have not digged into this, but what happens with short samples where the analyzer returns 0?
If this fixes an issue, it should go to the 2.3 branch.

@uklotzde
Copy link
Contributor Author

uklotzde commented May 12, 2020

I don't expect many tracks with bpm = 0. Repeatedly re-analyzing those very rare cases is a only minor issue compared to fixing tracks with wrong/missing analysis results for other users.

@daschuer
Copy link
Member

Ok, but please add a comment about this into the code

@uklotzde uklotzde added this to the 2.3.0 milestone May 13, 2020
@daschuer
Copy link
Member

Thank you. LGTM

@daschuer daschuer merged commit 1460d0f into mixxxdj:master May 16, 2020
@uklotzde
Copy link
Contributor Author

Oh, just noticed this was targeted to master instead of 2.3. Cherry pick the commits?

@daschuer
Copy link
Member

Oh sorry, I thought this was intended because of:

I didn't want to publish these changes to avoid breaking the analysis again.

This fixes a bug, right? So a cherry-pick is appropriate ...

daschuer added a commit that referenced this pull request May 17, 2020
Backport of #2776: Ensure that tracks with an invalid bpm are re-analyzed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants