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

Allow key file tags with tuning information like "A#m +50" #10992

Merged
merged 7 commits into from
Feb 8, 2023

Conversation

daschuer
Copy link
Member

This is written by Rapid Evolution

@daschuer
Copy link
Member Author

This PR fixes #10991 and #10990

@daschuer
Copy link
Member Author

daschuer commented Feb 5, 2023

This is open since three month without interest to test and review. I will remove it form the 2.3 milestone.

@daschuer daschuer removed this from the 2.3.4 milestone Feb 5, 2023
@ronso0
Copy link
Member

ronso0 commented Feb 7, 2023

So, this just strips the additional tuning info so Mixxx can recognise and import the base key?

Comment on lines +175 to +179
// Mixxx does not allow this but Rapid Evolution
// EXPECT_EQ(mixxx::track::io::key::A_FLAT_MAJOR, // ionian
// KeyUtils::guessKeyFromText(" g # - 50 cents "));
// EXPECT_EQ(mixxx::track::io::key::A_FLAT_MAJOR, // ionian
// KeyUtils::guessKeyFromText(" g # + 50 cents "));
Copy link
Member

Choose a reason for hiding this comment

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

wouldn't it be better to add another regular expression that implements the promiscuous rapid evolution format instead of manually trimming the it away?

Copy link
Member Author

Choose a reason for hiding this comment

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

Your comment is at the disabled test. Mixxx fails to pars that because of too many blanks. I do not consider the test data as realistic and failing is OK or even desired.

The tuning is trimmed away, because Mixxx does not make use of it right now.

The next iteration of making Mixxx tunig aware is to store the tuning information in the database. This is implemented here:
#11096 From this we can introduce the next iteration of making it tuning aware.

Copy link
Member

Choose a reason for hiding this comment

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

Yes thats exactly what I mean, if rapid evolution allows / exports data with that many blanks, we should accept it. Whats your reasoning for concluding that its not realistic?

Stripping the actual tuning information is fine for now imo.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is artificial data for a full test coverage of the Rapid Evolution key parser. No one exports the data like that.
Since the Mixxxx parser works differently this test is IMHO pointless for us.

Copy link
Member

Choose a reason for hiding this comment

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

I guess thats valid, lets just hope nobody does indeed export data like that just because its allowed in other software.

src/track/keyutils.cpp Outdated Show resolved Hide resolved
Comment on lines 251 to 259
// Remove Shift (Tuning) Information used by Rapid Evolution like: "A#m +50";
int shiftStart = text.indexOf('+');
if (shiftStart < 0) {
shiftStart = text.indexOf('-');
}
if (shiftStart >= 0) {
text = text.left(shiftStart);
}
const QString trimmed = text.trimmed();
Copy link
Member

Choose a reason for hiding this comment

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

I'd personally favor to change the regex's instead, but this is fine as stopgap solution if you insist.

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, once we are aware of tuning this needs to be replaced.

While the tuning issue exists, luckily most tracks are at A = 440 Hz. So this is something that is only reasonable with detector support like in Rapid Evolution.

A prominent out of tune Track is "Coldplay - The Scientist" which is recorded with an out of tune piano at A = 446 Hz
https://www.reddit.com/r/Coldplay/comments/8tjhwy/nearly_every_song_on_arobth_is_out_of_tune_or_not/

ChromaticKey KeyUtils::guessKeyFromText(const QString& text) {
QString trimmed = text.trimmed();
ChromaticKey KeyUtils::guessKeyFromText(QString text) {
Copy link
Member

Choose a reason for hiding this comment

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

Why the change from const-ref to by value?

Copy link
Member Author

Choose a reason for hiding this comment

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

Because text is no longer const and this function is used with l-values like
KeyUtils::guessKeyFromText("H")

Copy link
Member

Choose a reason for hiding this comment

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

Sure, if you think reassigning in the body is necessary, its no longer const. It could probably made const again though once that code has been replaced.

@daschuer
Copy link
Member Author

daschuer commented Feb 8, 2023

Done

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.

Thank you, I guess nobody else is interested in reviewing so I'll go ahead and merge

@Swiftb0y Swiftb0y merged commit c5aae4c into mixxxdj:2.3 Feb 8, 2023
@daschuer
Copy link
Member Author

daschuer commented Feb 9, 2023

Thank you.

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.

3 participants