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

BPM/tempo lock via MIDI? #13038

Closed
mxmilkiib opened this issue Apr 2, 2024 · 6 comments
Closed

BPM/tempo lock via MIDI? #13038

mxmilkiib opened this issue Apr 2, 2024 · 6 comments

Comments

@mxmilkiib
Copy link
Contributor

mxmilkiib commented Apr 2, 2024

Feature Description

See also #9978 #13031

@FrankwaP
Copy link
Contributor

FrankwaP commented Apr 2, 2024

Hey :-) I closed my recent PR as the work was a duplicate of yours… but as I said creating controls for locking/unlocking the tempo was my second objective, and here there are: https://github.com/FrankwaP/mixxx/tree/tempo_locking_controls

I've merged locally both our controls sets, created shortcuts and everything works! I've also checked that they were displayed in the MIDI wizard.

EDIT: One annoying thing I've noticed with my own controls, however: when calling these when the channel is empty, it causes a segmentation fault! And this happens quite fast when one thinks these controls apply to the selected track in the library and forget to load it in a channel.
So I'll get inspiration from your code. I already see you do not use new but std::make_unique.

@FrankwaP
Copy link
Contributor

FrankwaP commented Apr 3, 2024

I've modified my code so it's closer to yours, but my controls still crash Mixxx when the Channel is empty.

Aren't these lines in the slot functions supposed to handle this ?

    if (v <= 0) {
        return;
    }

@ronso0
Copy link
Member

ronso0 commented Apr 3, 2024

crash Mixxx when the Channel is empty

Sounds like you want to set beats on a track while the classes TrackPointer is null.
Just add null check like everywhere else in functions that operate on track objects.

@FrankwaP
Copy link
Contributor

FrankwaP commented Apr 3, 2024

Aaaaaaand done! Than you for the pointer, @ronso0 :-)

Do I make a PR ?

BTW I have fetched/merged @mxmilkiib 's work locally and made a specific/minimalist keyboard mapping for tracks preparation:

LoadSelectedTrack Shift+Left

cue_default f
play d

beats_set_halve F1
beats_set_twothirds F2
beats_set_threehalves F3
beats_set_double F4

beats_translate_earlier a
beats_translate_later z
unlock_tempo e
lock_tempo r

beatjump_backward q
beatjump_1_backward Shift+q
beatjump_forward s
beatjump_1_forward Shift+s

hotcue_1_activate w
hotcue_2_activate x
hotcue_3_activate c
hotcue_4_activate v
hotcue_5_activate Ctrl+w
hotcue_6_activate Ctrl+x
hotcue_7_activate Ctrl+c
hotcue_8_activate Ctrl+v
hotcue_1_clear Shift+w
hotcue_2_clear Shift+x
hotcue_3_clear Shift+c
hotcue_4_clear Shift+v
hotcue_5_clear Ctrl+Shift+w
hotcue_6_clear Ctrl+Shift+x
hotcue_7_clear Ctrl+Shift+c
hotcue_8_clear Ctrl+Shift+v

I just had a preparation session, and it goes faaaast <3

@ronso0
Copy link
Member

ronso0 commented Apr 3, 2024

Do I make a PR ?

Yes please!

@ronso0
Copy link
Member

ronso0 commented Apr 18, 2024

Implemented by #13041

@ronso0 ronso0 closed this as completed Apr 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants