Skip to content

Add 5/4 and 4/5 BPM scaling controls - #16026

Merged
daschuer merged 3 commits into
mixxxdj:mainfrom
Swarnadip-Kar:feature/bpm-fivefourths-fourfifths-scaling
Mar 9, 2026
Merged

Add 5/4 and 4/5 BPM scaling controls#16026
daschuer merged 3 commits into
mixxxdj:mainfrom
Swarnadip-Kar:feature/bpm-fivefourths-fourfifths-scaling

Conversation

@Swarnadip-Kar

Copy link
Copy Markdown
Contributor

Implements both the ×5/4 and ×4/5 BPM scaling options requested in #14686.

Changes

  • Adopts mxmilkiib's FiveFourths (5/4) implementation from Implement a fivefourths bpm scaling control #14780 (credit preserved via cherry-pick)
  • Adds the missing FourFifths (4/5 = 0.8x) counterpart across all layers:
    • BpmScale enum (src/track/beats.h)
    • Scale math (src/track/beats.cpp)
    • Engine control (bpmcontrol.cpp/.h) with key beats_set_fourfifths
    • Controller picker menu (controlpickermenu.cpp)
    • Right-click track menu (wtrackmenu.cpp/.h)
    • Track Properties BPM tab (dlgtrackinfo.cpp/.ui)
    • Unit tests (beatgridtest.cpp, beatmaptest.cpp)

Closes #14686
Based on work from #14780 by @mxmilkiib

Screenshots

Before

Before

After

After

@daschuer daschuer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Looks and works already good. Thank you.

With all these options showing the resulting BPM like in the context menu is very useful.
Do you have interest to add this also to the BPM window?

I have also noticed that we have different tooltips at the GUI buttons and the control picker. Fractional vs. Percent. Not sure what is the most convenient version, but we may use the same at both places. What wotks for you the best?

Testing this I have also came across some ideas for improvement.

The workflow of the deck preferrences menu is a big weak, because in almost all cases you want to verify the result in a deck. Especially with the factional multipliers an offset adjustment is probably also required. So a load button comes handy.

Interestingly the beat detector already knows the solution. Is is currently tunes for 120 BPM. We may rerun it with a different tuning. ... Idea for a different PR/feature request.

I also consider a online lookup interesting for example at tunebat. Maybe we can move the fetch a suggestion?
Also a future PR / feature request.

Comment thread src/library/dlgtrackinfo.cpp Outdated
@Swarnadip-Kar
Swarnadip-Kar force-pushed the feature/bpm-fivefourths-fourfifths-scaling branch from 6daf7ea to 64d9486 Compare February 23, 2026 08:38
@Swarnadip-Kar

Swarnadip-Kar commented Feb 23, 2026

Copy link
Copy Markdown
Contributor Author

Thanks for the thorough review and all the great ideas, @daschuer!

Showing resulting BPM in the Track Properties BPM tab — Great idea! I'll add this in a separate PR so the labels dynamically show the resulting BPM (e.g., "3/4 | 90 BPM"), just like the context menu already does.

Fractional vs. Percent tooltips — I think the fractional style (×5/4, ×4/5, etc.) is more intuitive for BPM scaling since DJs naturally think in terms of "double", "halve", "three-fourths". Percentages like "+25%" feel more abstract. Happy to align both the GUI buttons and the controller picker to use the fractional style — what do you think?

Load button in deck preferences workflow — That's a really useful idea for verifying BPM changes quickly. I'll keep that in mind for a future PR.

Beat detector re-tuning & online BPM lookup (tunebat) — Both great feature ideas! Would you like me to open feature request issues for these so they don't get lost?

For now, I'll address the // NEW comment removal in this PR and open the two follow-up PRs for the BPM preview and tooltip unification separately.

Quick note: the two follow-up PRs I mentioned will branch off this once it's merged. Happy to address any remaining review feedback here in the meantime.

Swarnadip-Kar added a commit to Swarnadip-Kar/mixxx that referenced this pull request Feb 23, 2026
Add updateBpmScaleButtonLabels() to update the BPM scale button
labels in the Track Properties dialog with the resulting BPM value,
matching the format already used in the track right-click context
menu (e.g. "3/4 BPM | 90 BPM").

Labels update in all BPM change code paths:
- Initial track load into the dialog (reloadTrackBeats)
- After a scale button is clicked (slotBpmScale)
- After the BPM is cleared (slotBpmClear)
- After manual edits to the BPM spin box (slotSpinBpmValueChanged)

Addresses feedback from @daschuer in mixxxdj#16026.
Swarnadip-Kar added a commit to Swarnadip-Kar/mixxx that referenced this pull request Feb 23, 2026
Add updateBpmScaleButtonLabels() to update the BPM scale button
labels in the Track Properties dialog with the resulting BPM value,
matching the format already used in the track right-click context
menu (e.g. "3/4 BPM | 90 BPM").

Labels update in all BPM change code paths:
- Initial track load into the dialog (reloadTrackBeats)
- After a scale button is clicked (slotBpmScale)
- After the BPM is cleared (slotBpmClear)
- After manual edits to the BPM spin box (slotSpinBpmValueChanged)

Addresses feedback from @daschuer in mixxxdj#16026.
@Swarnadip-Kar
Swarnadip-Kar force-pushed the feature/bpm-fivefourths-fourfifths-scaling branch from 9d2d7bd to 64d9486 Compare February 26, 2026 06:16
Milkii Brewster and others added 3 commits March 9, 2026 22:24
Complement the FiveFourths (5/4) scaling from mxmilkiib's commit
with its inverse FourFifths (4/5 = 0.8x) scaling.

Added across all layers: enum, beats math, engine control,
controller picker menu, right-click track menu, track properties
dialog, and unit tests.

Closes mixxxdj#14686
Rebased onto main after BPM lock toggle merge (mixxxdj#16025).
Ensures 5/4 and 4/5 scaling buttons respect the BPM lock
state, consistent with existing scaling controls.
@Swarnadip-Kar
Swarnadip-Kar force-pushed the feature/bpm-fivefourths-fourfifths-scaling branch from 64d9486 to 786e31a Compare March 9, 2026 17:12
@Swarnadip-Kar

Swarnadip-Kar commented Mar 9, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main after #16025 was merged. Also updated the 5/4 and 4/5 controls to respect the BPM lock state (consistent with the existing scaling controls), and fixed a small variable name typo that slipped through in #16025.

@daschuer ready for another look when you get a chance!

@daschuer daschuer left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM, Thank you.

@daschuer
daschuer merged commit fe3d37f into mixxxdj:main Mar 9, 2026
17 checks passed
Swarnadip-Kar added a commit to Swarnadip-Kar/mixxx that referenced this pull request Mar 10, 2026
Add updateBpmScaleButtonLabels() to update the BPM scale button
labels in the Track Properties dialog with the resulting BPM value,
matching the format already used in the track right-click context
menu (e.g. "3/4 BPM | 90 BPM").

Labels update in all BPM change code paths:
- Initial track load into the dialog (reloadTrackBeats)
- After a scale button is clicked (slotBpmScale)
- After the BPM is cleared (slotBpmClear)
- After manual edits to the BPM spin box (slotSpinBpmValueChanged)

Addresses feedback from @daschuer in mixxxdj#16026.
@ronso0

ronso0 commented Mar 10, 2026

Copy link
Copy Markdown
Member

We should stretch the TAP button to four rows.

@Swarnadip-Kar

Swarnadip-Kar commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

We should stretch the TAP button to four rows.

Since this is already merged, I'll open a separate PR for this. Unless you'd prefer I bundle it into #16141 which touches the same area?

@Swarnadip-Kar

Swarnadip-Kar commented Mar 10, 2026

Copy link
Copy Markdown
Contributor Author

Also wondering if the button order makes sense to revisit — ideally inverse pairs like ×2/÷2, ×5/4/×4/5 should sit next to each other so it's easy to undo a misclick. Could bundle this along with the TAP button fix into one PR if that works better.

@ronso0

ronso0 commented Mar 10, 2026

Copy link
Copy Markdown
Member

Yes, please open a PR with for the stretched TAP button and the pairing 👍

Swarnadip-Kar added a commit to Swarnadip-Kar/mixxx that referenced this pull request Mar 11, 2026
Add updateBpmScaleButtonLabels() to update the BPM scale button
labels in the Track Properties dialog with the resulting BPM value,
matching the format already used in the track right-click context
menu (e.g. "3/4 BPM | 90 BPM").

Labels update in all BPM change code paths:
- Initial track load into the dialog (reloadTrackBeats)
- After a scale button is clicked (slotBpmScale)
- After the BPM is cleared (slotBpmClear)
- After manual edits to the BPM spin box (slotSpinBpmValueChanged)

Addresses feedback from @daschuer in mixxxdj#16026.
Swarnadip-Kar added a commit to Swarnadip-Kar/mixxx that referenced this pull request Mar 11, 2026
Add updateBpmScaleButtonLabels() to update the BPM scale button
labels in the Track Properties dialog with the resulting BPM value,
matching the format already used in the track right-click context
menu (e.g. "3/4 BPM | 90 BPM").

Labels update in all BPM change code paths:
- Initial track load into the dialog (reloadTrackBeats)
- After a scale button is clicked (slotBpmScale)
- After the BPM is cleared (slotBpmClear)
- After manual edits to the BPM spin box (slotSpinBpmValueChanged)

Addresses feedback from @daschuer in mixxxdj#16026.
@Swarnadip-Kar
Swarnadip-Kar deleted the feature/bpm-fivefourths-fourfifths-scaling branch March 28, 2026 05:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5/4 and 4/5 BPM adjustments

3 participants