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

Inconsistent/wrong musical keys in the UI #12044

Closed
fwcd opened this issue Sep 29, 2023 · 3 comments
Closed

Inconsistent/wrong musical keys in the UI #12044

fwcd opened this issue Sep 29, 2023 · 3 comments
Labels

Comments

@fwcd
Copy link
Member

fwcd commented Sep 29, 2023

Bug Description

Switching the key notation mode (e.g. Traditional <-> Lancelot/Traditional) causes the key to change, additionally jumping down/up a semitone doesn't always land on the starting key, especially after changing the notation mode. See the video for a short demo:

demo.mp4

Anyone's got an idea what the issue could be?

Version

2.5-alpha-114-g75ac186cfa

OS

macOS 14.0

@fwcd fwcd added the bug label Sep 29, 2023
@fwcd
Copy link
Member Author

fwcd commented Oct 1, 2023

I suspect this to be some kind of rounding error, but I'll have to investigate it more deeply

@fwcd
Copy link
Member Author

fwcd commented Oct 1, 2023

Dug around a little more and found that my confusion around the implementation of WKey actually was the source of the issue. Notice how each key notation always produces the same key in the UI:

Screen.Recording.2023-10-01.at.19.14.35.mov

The issue is that the key of the track is set to the key notation index, which it obviously shouldn't be. Here's the problematic line (which seems to have been introduced as early as 2019):

void WKey::keyNotationChanged(double dValue) {
setValue(dValue);
}

Should be easy-ish to fix though. Perhaps we should just use more descriptive variable names (and perhaps avoid passing enum indices as doubles?).

cc @daschuer

@fwcd
Copy link
Member Author

fwcd commented Oct 3, 2023

Fixed as of #12051

@fwcd fwcd closed this as completed Oct 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant