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

add Rate Tap button #12104

Merged
merged 9 commits into from
May 20, 2024
Merged

add Rate Tap button #12104

merged 9 commits into from
May 20, 2024

Conversation

ronso0
Copy link
Member

@ronso0 ronso0 commented Oct 14, 2023

  • add tempo_tap which works exactly like BPM tap, just it sets the tempo
  • change BPM display overlay and buttons in skins to do
    • tempo tap on left click
    • BPM tap on right-click.

quoting myself from #12086

Admittedly, I never understood why this a track edit tool [BPM tap button] was placed in the rate control section in the first place.

double-clicking any track (text) label opens the Track Properties editor where the (track) BPM can be set (type or tap)
Use case

Reasoning

BPM tap edits a track property (permanently) while the rate section is solely about controlling the playback speed (+, -, sync). Hence, IMO BPM tap doesn't belong there.
IIUC the intention for putting it there was to allow setting the track BPM, i.e. set initial value or correct BPM analysis. I assume it was helpful in the early days of Mixxx but with the improved beats analyzer nowadays I suppose it's not needed (that much) anymore. Manual correction can be done in Track Properties > BPM tab.

My use case

Infrequently I need to "Sync" to external players (vinyl via Aux, other DJ in b2b sessions), i.e. at least estimate the target BPM. Until now I was using a Python BPM counter [1], activated with a global hotkey, which gives very accurate results. However, it'd be much more convenient to do this within Mixxx.
Either I apply the guessed target BPM (e.g. 128) to loaded tracks, or I do a bpm search bpm:125-130.
Rate Tap is a good step forward.

Thinking this further, a BPM tap utility might be helpful, see #12105

@github-actions github-actions bot added the skins label Oct 14, 2023
@ronso0 ronso0 mentioned this pull request Oct 14, 2023
@fwcd fwcd added the bpm label Oct 14, 2023
@ghost

This comment was marked as off-topic.

@ronso0

This comment was marked as off-topic.

@ronso0
Copy link
Member Author

ronso0 commented Oct 14, 2023

Very weird: I built this locally and it works as expected.
Though, it was built with Qt5 because I forgot to set the Qt6 switch.
So with Qt6 slotUpdateRateSlider(double bpm) is not called when BPM are tapped, even though it should

m_pEngineBpm = new ControlLinPotmeter(
ConfigKey(group, "bpm"),
kBpmRangeMin,
kBpmRangeMax,
kBpmRangeStep,
kBpmRangeSmallStep,
true);
m_pEngineBpm->set(0.0);
connect(m_pEngineBpm, &ControlObject::valueChanged,
this, &BpmControl::slotUpdateRateSlider,
Qt::DirectConnection);

When I change bpm from dev tools it works, it just doesn't when bpm is set in slotRateTapFilter 🤷
It also works if I make bpm read-only and use connectValueChangeRequest and copy all required calls there.

Also, I have no idea why unrelated tests fail on all OS except ARM 64, for example https://github.com/mixxxdj/mixxx/actions/runs/6517384471/job/17707390983?pr=12104

I'd appreciate if someone could give me some hints what's wrong here.

@ronso0
Copy link
Member Author

ronso0 commented Oct 15, 2023

I pushed a different (working) version with my findings added inline.

@ronso0 ronso0 mentioned this pull request Oct 22, 2023
@ronso0 ronso0 force-pushed the tap-rate-button branch 2 times, most recently from 9f5aef3 to 8d02348 Compare November 2, 2023 13:54
@ronso0
Copy link
Member Author

ronso0 commented Nov 2, 2023

Very weird: I built this locally and it works as expected. Though, it was built with Qt5 because I forgot to set the Qt6 switch. So with Qt6 slotUpdateRateSlider(double bpm) is not called when BPM are tapped, even though it should
...

Seems this is a known issue? Just stumbled upon

void BroadcastManager::setEnabled(bool value) {
m_pBroadcastEnabled->set(value);
// TODO(Palakis): apparently, calling set on a ControlObject and not through
// a ControlProxy doesn't trigger the valueChanged signal here.
// This is a quick fix, but there has to be a better way to do this, rather
// than calling the associated slot directly.
slotControlEnabled(value);
}

Still wondering why the comment was written for Qt5 whereas it worked here with Qt5 and fails with Qt6 🤷
I changed it to call the slot manually.

@ronso0
Copy link
Member Author

ronso0 commented Nov 2, 2023

I changed all skin buttons to tap the tempo on left click and tap the BPM on right click.

@ronso0 ronso0 marked this pull request as ready for review November 2, 2023 16:29
@ronso0 ronso0 force-pushed the tap-rate-button branch 2 times, most recently from 3aa3e8f to 7387c6f Compare November 3, 2023 16:45
@ronso0
Copy link
Member Author

ronso0 commented Nov 3, 2023

I changed it to tempo_tap to make it more clear what it does.

Ready to roll!

@ronso0 ronso0 force-pushed the tap-rate-button branch 2 times, most recently from 7f1769b to 7fbe271 Compare November 5, 2023 21:50
@ronso0 ronso0 added this to the 2.5.0 milestone Dec 3, 2023
@fwcd
Copy link
Member

fwcd commented Feb 18, 2024

I assume it was helpful in the early days of Mixxx but with the improved beats analyzer nowadays I suppose it's not needed (that much) anymore

I use the BPM tap pretty frequently on tracks where the analyzer still struggles (acapellas or tracks with complex polyrhythms, e.g. Salsa music). Would appreciate to keep having at least an option for making BPM tap available in the UI, having to dig into the track properties makes this too inconvenient to really be useful IMHO.

Edit: Ah, I should've read the entire description, BPM tap on right-click seems like a good compromise, but right-clicking on a laptop trackpad is potentially still a bit cumbersome. I'm not sure of a good UI alternative though, perhaps a switch in the skin settings to toggle left/right-click behavior? Moving the BPM tap to the beatgrid editing sections seems reasonable too, to untangle the BPM editing controls from rate changing.

@ronso0
Copy link
Member Author

ronso0 commented Feb 18, 2024

Moving the BPM tap to the beatgrid editing sections seems reasonable too, to untangle the BPM editing controls from rate changing.

Good idea!
Feasible in Tango and LateNight, not so nice in Deere but the BPM control section is already interfering anyway with the track dsiplays.

perhaps a switch in the skin settings to toggle left/right-click behavior?

Hmm, the skin settings menu is growing and growing, in LateNight we already had to squeeze so it fits at minimum height.
At some point we need to wrap it into a WScrollable #3890 (still unused in official skins)

@daschuer
Copy link
Member

Can you move the first commit to a separate PR?
This way we see here better the proposed functional changes.

@ronso0
Copy link
Member Author

ronso0 commented Feb 19, 2024

Why not view by commit?

@ronso0
Copy link
Member Author

ronso0 commented Feb 19, 2024

The essence is a84e206 and it's rather small IMO.

@daschuer
Copy link
Member

daschuer commented May 8, 2024

Now a conflict has developed.

@ronso0
Copy link
Member Author

ronso0 commented May 8, 2024

Moving the BPM tap to the beatgrid editing sections seems reasonable too, to untangle the BPM editing controls from rate changing.

Just filed a feature request to track this.

perhaps a switch in the skin settings to toggle left/right-click behavior?

Hmm, the skin settings menu is growing and growing, in LateNight we already had to squeeze so it fits at minimum height. At some point we need to wrap it into a WScrollable #3890 (still unused in official skins)

I'll look into this during beta.

@ronso0
Copy link
Member Author

ronso0 commented May 8, 2024

Conflicts are resolved.

@daschuer
Copy link
Member

Now the unit-test are failing.

src/engine/controls/bpmcontrol.cpp Outdated Show resolved Hide resolved
@daschuer
Copy link
Member

Oh sorry, and new conflicts have developed.

@ronso0 ronso0 force-pushed the tap-rate-button branch from c724579 to 39f716f Compare May 14, 2024 20:59
@ronso0 ronso0 force-pushed the tap-rate-button branch from 39f716f to 47c9cb5 Compare May 14, 2024 23:24
@ronso0
Copy link
Member Author

ronso0 commented May 14, 2024

Oh sorry, and new conflicts have developed.

Yeah, a lot has happend in BpmControl since I started this.
I rebased and it looks & works good now, let's see what CI says.

@ronso0
Copy link
Member Author

ronso0 commented May 14, 2024

small TODO:
highlight the tap button also on right-click. Not sure how to do that, though.

Copy link
Member

@Swiftb0y Swiftb0y left a comment

Choose a reason for hiding this comment

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

Only nitpick. rest LGTM. haven't tested though

src/engine/controls/bpmcontrol.cpp Outdated Show resolved Hide resolved
@daschuer
Copy link
Member

Thank you.

@daschuer daschuer merged commit 5286fa2 into mixxxdj:main May 20, 2024
13 checks passed
@ronso0 ronso0 deleted the tap-rate-button branch May 20, 2024 16:47
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.

4 participants