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

Rhythm note input mode fixes and improvements #6232

Merged
merged 4 commits into from
Jun 22, 2020

Conversation

MarcSabatella
Copy link
Contributor

This PR fixes a number of small but collectively serious issues with the "rhythm" note input mode workflow. Where possible, these are separated into individual commits, but they all relate to each other and are thus collected in this one PR.

To me these should probably be merged together, and I would advocate it happen for 3.5. No string changes, no document changes required although we could mention the new behavior in 1a) rather than let people discover it for themselves. Mostly it just improves the rhythm mode workflow with no penalty.

1a) As discussed on the forum (see for instance https://musescore.org/en/node/306781 and many previous discussions in the past), always defaulting to the middle line when entering notes is not optimal. If you want that, fine, but many people want to be able to choose a pitch. This PR simply copies the previous pitch, so while the first pitch you enter default to the middle line, if you immediately repitch using Up/Down, the next note inherits that pitch. This is valuable for people trying to use this mode to input notes using cursor and duration only, and is especially valuable for drums

1b) There was a bug where the initial note for both drum and tab staves was poorly chosen, since the original calculation only worked for pitched staves. This makes a better choice for drum staves (use current drum not from palette, or first valid drum note in set) and tab (use fret 0 of current string). It also corrects the "middle line" calculation for standard staves of other than 5 lines.

  1. The originally intended purpose of rhythm mode was a prelude to repitch, but repitch produces incorrect results on drum staves - again, the pitch calculation assumed a standard staff. Corrected honor the drumset shortcuts correctly.

Note: there is also a crash when attempting to repitch a drum staff with the mouse, possible to reproduce without this PR but more likely now. Fix coming...

  1. Triple and quadruple dots were not working in rhythm mode due to a simple oversight, fixed here.

  2. Rhythm mode was difficult to enable on drum staves, because it was actually ignored when setting the internal mode. The only way to get a drum staff into rhythm mode was to change modes while on a standard staff, then change to the drum staff. Again, just some missing code, added here.

Resolves: https://musescore.org/en/node/306936

Currently we always use the middle line
when entering pitches in rhyhtm mode.
This simply improves the algiorthm
to use the last entered pitch instead,
to facilitate a repitch-as-you-go approach
that has been a common request especially lately.

Also improved the default when these is no last entered pitch.
Previously we always tried to use line = 4,
which may or may not be the middle line.
Now we actually calculate the true middle.
For drum staves, this value produced random results,
because it depended on a pitch calculation.
I replaced this with using the current drum note from palette,
or first valid note in drumset.
For tab, the original algorithm also produced meaningless results,
usually resulting in an unplayable low note on the bottom string.
Instead, I use fret 0 of the current string.
Resolves: https://musescore.org/en/node/154816

Repitch mode replaces the current note with the new note.
But the calculation did not take drum staves into account.
Fix is to use the current drumnote when repitching.
Resolves: https://musescore.org/en/node/306687

Missing case in switch to handle triple & quadruple dots
when entering notes in rhythm mode.
Resolves: https://musescore.org/en/node/276671

When switching note input modes (steptime, repitch, rhythm, etc),
the handlers for drum and tab staves was missing the code
to actually set the mode.
So the icon would show the change but no change was registered.
This made rhythm mode difficult to use for drum staves;
you needed to discover the problem and workaround.
Tablature doesn't actually implement all these modes,
but it is still important to set the mode correctly internally
so it reflects the icon correctly when switching staves.
Added the code to do this.
@MarcSabatella
Copy link
Contributor Author

... fixed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants