Lmms: Clicking to the right of black keys plays their notes on the keyboard of the Piano Roll editor.

Created on 5 Aug 2017  路  14Comments  路  Source: LMMS/lmms

Clicking to the right of black keys plays them in the piano of the Piano Roll editor, which shouldn't happen and isn't sensible or logical.
An example of the area where this behavior is happening but it shouldn't (highlighted in yellow):
snip_20170805194251
The piano of instrument plug-ins behaves the way it should, and the piano of the Piano Roll editor should do the same.

bug gui

All 14 comments

Confirmed.

I would like to fix this issue by myself.
I think what I need to know to do so is where the code of the rectangle that when is clicked its black key is played. I think the code is in _src/gui/editors/PianoRoll.cpp_ but the file is too big and I couldn't find what I'm looking for.
I think limiting the size of this rectangle to the size of the black key, so clicks to the right of it won't play it, should solve the issue.

I've been reworking the Piano Roll editor for a few bugs and I could "fix" this, but it would make things more complex (code-wise) and honestly I don't believe it actually needs fixing.

  1. Currently if you hover over the piano keys you'll also see which key you're hovering in the notes area related to the mouse position. This by itself should be easy enough to tell you what note you're clicking, even if you're hovering over the white portion of the black key.
  2. For this change, this would be reducing the clickable area for the black keys, which in my opinion is not a good thing given how small of an area they already contain.
  3. For this change, while you are hovering over the white key in the black key line, it will have to highlight a different key line. This means that if you just move the mouse directly to the right you will not be on the note line you were just hovering over. For example, if you're hovering over C4 on the C#4 line in the example image, the highlighted note would have to be C4. If you moved directly right to add the C4 note and clicked to add it, you'd be adding the C#4 note instead because you're on it's line now instead of C4's line.

So, in my opinion the negatives of this change outweighs the "logical" positives. But if this is something that really wants to be adjusted, I can do it (albeit begrudgingly).

@Veratil Thanks for looking into this. Your reasons make some sense, especially the 3rd one.

However, I think we should do something about this issue and the inconsistency between the 2 piano views.

I suggest a new design: flat piano keys, where all of them have identical dimensions.
This will fix this issue, fix the inconsistency, and simplify the code a lot.

@Veratil Thanks for looking into this. Your reasons make some sense, especially the 3rd one.

Yep yep. I've been working on this for the past week so when I saw this I knew I could give some input. 馃槃

However, I think we should do something about this issue and the inconsistency between the 2 piano views.

I suggest a new design: flat piano keys, where all of them have identical dimensions.
This will fix this issue, fix the inconsistency, and simplify the code a lot.

This would simplify a lot, yes.

Something I just thought of earlier: what if we flipped the keyboard? That way the "back" of the key is facing the notes area instead of the current "awkward" way.

what if we flipped the keyboard?

@Veratil I think that would look strange.

what if we flipped the keyboard?

@Veratil I think that would look strange.

Would it? Imagine this just rotated.

@Veratil That actually looks fine, but I don't see a benefit from switching to it.
Don't you think flat piano keys are the way to go?

For reference, Ableton Live piano roll:
image

I think that looks pretty good. I wouldn't mind replicating that.

I've already put up the PR for the rewrite I was doing (#5253), but I can still rework the key drawing. :)

I've already put up the PR for the rewrite I was doing (#5253), but I can still rework the key drawing. :)

@Veratil No need to. I will tackle that in a new PR soon.

I've already put up the PR for the rewrite I was doing (#5253), but I can still rework the key drawing. :)

@Veratil No need to. I will tackle that in a new PR soon.

If you base it off my PR and have any questions let me know. I tried to make it as easy to follow as possible!

And I never opened the PR...

@Veratil Feel free to implement flat piano keys in your PR.

And I never opened the PR...

@Veratil Feel free to implement flat piano keys in your PR.

Alright!

I've made the keys customizable in width and brush (color/gradient) through CSS instead of being a loaded pixmap:
lmms-keyroll-compare
lmms-keyroll-customization

Was this page helpful?
0 / 5 - 0 ratings

Related issues

Andrewer11 picture Andrewer11  路  3Comments

binyominzeev picture binyominzeev  路  3Comments

mikobuntu picture mikobuntu  路  4Comments

DomClark picture DomClark  路  3Comments

Spekular picture Spekular  路  4Comments