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

Import saved loops from Serato Tags #2673

Merged
merged 12 commits into from
May 7, 2020

Conversation

Holzhaus
Copy link
Member

Based on: #2526, #2667

This also imports saved loops from the Serato metadata tags. The will be stored as cues of type CueType::Loop. Since hotcues and loops are separate lists in Serato, loop indices are shifted by 8 (which is the maximum number of hotcue in Serato). This means that the first loop has hotcue number 8 instead of 0.

src/track/serato/tags.cpp Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

How does Mixxx currently behave with multiple LOOP type cues? Does it just ignore them except for the first one?

@Holzhaus
Copy link
Member Author

It ignores them completely for some reason. But I can see them when I run a Select statement on the mixxxdj manually. I didn't investigate it further.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

I think that is what should happen until we support merge #2194.

@Holzhaus
Copy link
Member Author

Possible, but I expected one of them to show up as the last used loop.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

Oh, yeah that isn't good. I think Mixxx should use the lowest indexed loop.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

That could be implemented in a separate PR.

@Swiftb0y
Copy link
Member

This means that the first loop has hotcue number 8 instead of 0.

Even though we have support for more than eight hotcues, the skins usually only show the first eight maximum, making the loopcues inaccessible from the skins, right?

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

They will still show on the waveforms and be accessible from controllers. For 2.4 we may consider adding a way to switch between pages of hotcues, which would be similar enough to how Serato switches between regular hotcues and loops.

@Holzhaus
Copy link
Member Author

Yes. But I guess that most Serato users have a Serato controller with a dedicated loop mode that can be used.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 17, 2020

Regardless, only the first loop is usable currently because we have no GUI nor ControlObjects for managing multiple loops. This PR imports the rest of the loops to avoid data loss so they will be useable in 2.4.

@Holzhaus
Copy link
Member Author

I don't know how Mixxx saves the last used loop though. Might be possible that it just deletes all loop cues before it does that. We'll need to look into that.

@Holzhaus Holzhaus force-pushed the serato-markers-integration-loops branch from 00f37e2 to 41814b9 Compare April 17, 2020 22:28
@Be-ing
Copy link
Contributor

Be-ing commented Apr 18, 2020

Loading of loop cues is a mess. Strangely it is handled by BaseTrackPlayerImpl::loadTrack, not LoopingControl. There is a loop there which breaks after the first found loop, as I expected.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 18, 2020

BaseTrackPlayerImpl::unloadTrack does not break after the first found LOOP cue though, so it saves the last LOOP cue. I think inserting a break; there is all that is needed.

@Holzhaus
Copy link
Member Author

#2678

I also check if a hotcue number is set. We don't want to overwrite our precious saved loops by volatile "most recent loops".

@Holzhaus Holzhaus changed the title [WIP] Import saved loops from Serato Tags Import saved loops from Serato Tags Apr 18, 2020
@Holzhaus Holzhaus changed the title Import saved loops from Serato Tags [WIP] Import saved loops from Serato Tags Apr 18, 2020
@Holzhaus Holzhaus added this to the 2.3.0 milestone Apr 22, 2020
@Holzhaus
Copy link
Member Author

I applied the beta blocker tag because I split this off from #2526 to keep the PR small.

@Be-ing
Copy link
Contributor

Be-ing commented Apr 22, 2020

I think we should merge #2678 before this.

@Holzhaus Holzhaus force-pushed the serato-markers-integration-loops branch from 0077889 to 41f3717 Compare April 23, 2020 08:41
src/track/serato/tags.cpp Outdated Show resolved Hide resolved
src/track/serato/tags.cpp Outdated Show resolved Hide resolved
src/track/serato/tags.cpp Outdated Show resolved Hide resolved
Co-Authored-By: Be <be.0@gmx.com>
@Holzhaus Holzhaus marked this pull request as ready for review April 26, 2020 14:22
@Holzhaus Holzhaus changed the title [WIP] Import saved loops from Serato Tags Import saved loops from Serato Tags Apr 26, 2020
@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2020

I resolved the merge conflicts and added support for using saved loops as hotcues for now. Please test.

Here is a sample file:
https://transfer.sh/unO9x/hotcues-and-loops.flac
(Got the track from Soundcloud: Perséphone - Retro Funky (SUNDANCE remix), CC-BY 3.0 licensed, https://soundcloud.com/sundancemusic/pers-phone-retro-funky)

Copy link
Member

@daschuer daschuer left a comment

Choose a reason for hiding this comment

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

Some minor comments.

src/engine/controls/cuecontrol.cpp Outdated Show resolved Hide resolved
break;
}
default:
continue;
Copy link
Member

Choose a reason for hiding this comment

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

can we DEBUG_ASSERT(!"unknown cue type") or such?

Copy link
Member Author

Choose a reason for hiding this comment

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

I don't think so. The loop goes over all cue points regardless of type. I think the other types (Beginning, AudibleSound, etc.) are supposed to be silently ignored.

@daschuer
Copy link
Member

daschuer commented May 6, 2020

LGTM, @Be-ing: merge?

@Be-ing
Copy link
Contributor

Be-ing commented May 6, 2020

No, we need to think through this carefully.

@Be-ing
Copy link
Contributor

Be-ing commented May 6, 2020

I'm unclear what the plan is now between this and #2678. Splitting these into separate PRs has fragmented the discussion. What are you proposing to do with regard to Mixxx's single loop? Using the first numbered loop cue? So the first loop cue is used both for the single unnumbered loop and a hotcue?

@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2020

What are you proposing to do with regard to Mixxx's single loop? Using the first numbered loop cue? So the first loop cue is used both for the single unnumbered loop and a hotcue?

Yes. If no restored loop from the last session exists, it makes sense to restore the saved loop with the lowest hotcue number instead. As soon as the track is unloaded, it stored as a regular "restored loop" without a hotcue number (the actual saved loop cue will remain unchanged).

@Be-ing
Copy link
Contributor

Be-ing commented May 6, 2020

If restored loop from the last session exists, it makes sense to restore the saved loop with the lowest hotcue number instead.

Why? I would only expect the unnumbered loop to be loaded from an imported numbered loop if there was no unnumbered loop saved.

@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2020

Sorry, I was answering on my phone and apparently missed to add a "no". You are right, this is exactly what I have in mind. I edited my previous comment.

@Be-ing
Copy link
Contributor

Be-ing commented May 6, 2020

Okay, this seems like a reasonable hack. I'll give it a test with that example file.

src/track/serato/tags.cpp Outdated Show resolved Hide resolved
@Be-ing
Copy link
Contributor

Be-ing commented May 6, 2020

Okay, I tested and this LGTM aside from some minor improvements to the comments. This seems to work fine without #2678, so what is the plan for #2678? Close it without merging?

@Holzhaus
Copy link
Member Author

Holzhaus commented May 6, 2020

No, we still need #2678. Without it, saved loops might be overwritten because it just uses the last loop cue that is found to save the restored loop. Also, Mixxx will always restore the first loop cue in the list which might have a hotcue number - even another loop cue without a hotcue number exists.

@Be-ing
Copy link
Contributor

Be-ing commented May 7, 2020

Thank you!

@Be-ing Be-ing merged commit 8f7f352 into mixxxdj:master May 7, 2020
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