Skip to content

Conversation

@peppy
Copy link
Member

@peppy peppy commented Jul 25, 2025

As proposed in #34152.

@peppy peppy force-pushed the bpm-grouping-more-precision branch from f8bb3b2 to e34f181 Compare July 25, 2025 07:38
@peppy peppy added the quick fix Tasks which were taken on because they take no time to fix label Jul 25, 2025
@peppy peppy force-pushed the bpm-grouping-more-precision branch from e34f181 to c6cbda5 Compare July 25, 2025 08:55
@peppy peppy moved this from Next up to Pending Review in osu! untitled project Jul 26, 2025
@bdach bdach self-requested a review July 28, 2025 07:01
if (bpm < 60)
return new GroupDefinition(60, "Under 60 BPM");

for (int i = 60; i < 300; i += 10)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
for (int i = 60; i < 300; i += 10)
for (int i = 70; i < 300; i += 10)

Starting at i = 60 means there's an extra dead iteration of the loop every time.

private GroupDefinition defineGroupByBPM(double bpm)
{
for (int i = 1; i < 6; i++)
if (bpm < 60)
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is sorta orthogonal to the issue here but I do wonder about using raw unrounded BPM, because on displays we use

/// <summary>
/// Applies rounding to the given BPM value.
/// </summary>
/// <param name="baseBpm">The base BPM to round.</param>
/// <param name="rate">Rate adjustment, if applicable.</param>
public static int RoundBPM(double baseBpm, double rate = 1) => (int)Math.Round(baseBpm * rate);

and therefore stuff can be wonky (i.e. a 59.6 BPM beatmap being grouped into <60 BPM group but displaying as 60 BPM).

Copy link
Member Author

Choose a reason for hiding this comment

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

Hmm, seems like a good opportunity to fix / test coverage this.

@bdach bdach merged commit 2e8ab15 into ppy:master Jul 28, 2025
7 of 9 checks passed
@github-project-automation github-project-automation bot moved this from Pending Review to Done in osu! untitled project Jul 28, 2025
@peppy peppy deleted the bpm-grouping-more-precision branch July 29, 2025 07:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:song-select quick fix Tasks which were taken on because they take no time to fix size/S

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

2 participants