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

Lyrics: Better dash control #2239

Merged
merged 2 commits into from
Oct 27, 2015
Merged

Lyrics: Better dash control #2239

merged 2 commits into from
Oct 27, 2015

Conversation

mgavioli
Copy link
Contributor

This patch gives better control on lyrics dash management and it is intended to supersede #2213 which did not suit the taste of several forum users.

References:

Adds 3 new score style parameters:

  • lyricsDashMinLength to control the minimum dash length (default: 0.4sp)
  • lyricsDashMaxLength to control the maximum dash length (default: 0.8sp)
  • lyricsDashForce: if set to true, a dash is always generated between two syllables of a word and, if there is not enough space for the min dash length, more space is added between the syllables to accommodate it; if set to false, no extra space is added and the two syllables are joined together (default: true)

The effect of the last parameter is exemplified by the following screen-shots:

Current situation (before this patch); if there is no room for the min dash length, the dash is skipped and some blank is left between syllables (-pre dan-):
test_sylldash_old

Patch with lyricsDashForce = true; syllable chords are further spaced and a min-length dash is inserted (-pre-dan-), at the cost of looser fitting and of altering the proper note spacing:
test_sylldash_with

Patch with lyricsDashForce = false: the second syllable is moved (slightly) to the left to reclaim the blank (-predan-), keeping the best possible fitting and note spacing:
test_sylldash_without

User controls for the three parameters have been added to "Style | General" dialogue box, "Sizes" tab.

__Background__: When between two lyrics with a dash there is no room for at least a minimal length dash, no dash is drawn at all and a small blank is potentially left between the syllables.

__Fix__: In such a case, this fix shifts the second lyrics left to avoid the blank.

__Notes__:
- This alters slightly the alignment of the lyrics with the note head, the worst case being 0.45sp (0.25 of minimum dash length + 0.1 of padding at either end); however, the greatly improved readability minimizes the impact of this (usually minimal) misalignment.
- kerning between the previous syllable last character and the first character of the next syllable is ignored.
- No provision is made for languages in which hyphenated spelling is different from continuous spelling (examples?)
@Jojo-Schmitz
Copy link
Contributor

I like the look (and the alternative) better. But wouldn't it be simpler (and more intuitive) to have lyricsDashMinLength decide whether or not a dash is shown? Set to 0 and none will be shown, set to something >0 and it it will be forced? Not quite sure whether lyricsDashMaxLength is needed and for what purpose.

@mgavioli
Copy link
Contributor Author

mgavioli commented Oct 1, 2015

@Jojo-Schmitz : maybe simpler, but to my (twisted?) mind not intuitive at all; a dash 0.01sp long would look absurd. The point is not to hide the dash unconditionally, but only if it "does not fit"; and for this a threshold (a minimum length) is needed below which it is possible to say that "it does not fit".

The max length is exactly that: it defines the extension of the 'full' dash, when there is no space constrain and the dash can be drawn in full. The length appears to vary in editions from different publishers and different users may like different lengths, as the space between bar line and note, between note and bar line, accidental and note and so no, are configurable.

@Jojo-Schmitz
Copy link
Contributor

a dash of 0.01sp would (almost but close enough) look like it currently does, so why now?
Good point about max length, I'm not against it but didn't see a real Need.

@shoogle
Copy link
Contributor

shoogle commented Oct 1, 2015

These are both greatly improved over the current default, good job!

I personally find it much easier to read with a dash (i.e. lyricsDashForce = true)

Patch with lyricsDashForce = true; syllable chords are further spaced and a min-length dash is inserted (-pre-dan-), at the cost of looser fitting and of altering the proper note spacing.

Why not keep the proper note spacing and simply move the "dan" syllable right a bit to make room for the dash? The "dan" would no longer fall directly under the minim (half-note) but it would still be perfectly readable. I know that this is not always an option (i.e. it wouldn't work if there was a sequence of closely-spaced notes) but it could work very well when only two or three notes are close together.

@MarcSabatella
Copy link
Contributor

@shoogle : to me that might be a valid personal choice in some cases, but I don't think it is standard behavior and should not be done by default, unless you can find an authoritative reference and published examples that recommend this.

@mgavioli
Copy link
Contributor Author

mgavioli commented Oct 1, 2015

@Jojo-Schmitz : I think this reply on the forum thread addresses your concern about min dash length: https://musescore.org/en/node/81796#comment-361431

@shoogle
Copy link
Contributor

shoogle commented Oct 1, 2015

@MarcSabatella : fair enough. I don't have a reference (haven't time to look currently) so perhaps it shouldn't be the default, but it strikes me it could be sensible and efficient behaviour if the user were to reduce the stretch below 100% on such a bar.

@MarcSabatella
Copy link
Contributor

I reduce stretch all the time for various different reasons, none of which should result in non-standard lyrics placement. Again, if you personally have a special case reason to want to adjust certain syllables, you are welcome to do so manually, but MuseScore's default behaviors should give standard, not non-standard, layout.

@shoogle
Copy link
Contributor

shoogle commented Oct 3, 2015

I didn't realise that "reduce stretch" tries to preserve standards compliance. I had assumed that 100% stretch would be "as compact as possible without breaking standards compliance". Since that's not the case and standards compliance is preserved after all, I guess it explains why things break so quickly as you reduce stretch and keep reducing it.
I often use "reduce stretch" and have thought for a long time that it is looking to save space in the wrong places. I am regularly disappointed with how little the stretch can be reduced before the layout corrupts. Perhaps I will have a go at implementing an optional "Relaxed Standards Compliance Mode" in the preferences where the normal compliance rules are usually enforced, but may be bent, or even broken slightly, if enables a more compact layout or otherwise improves the appearance of the score.

@MarcSabatella
Copy link
Contributor

100% stretch doesn't mean as compact as possible; it means apply the default spacing according to your current settings - in particular, Style / General / Spacing. It's really just an measure-specific override to that score-wide setting.

Reducing stretch is basically the same as reducing that setting, but there are lots of other relevant settings that influence how comapct your music can be laid out. See in particular "Minimum note distance" but also other settings in there. If you want highly comrpess music, you can generally get it already just by changing style settings, no need for stretch adjustments.

@MarcSabatella
Copy link
Contributor

Also, FWIW, it's not really about strictly enforcing compliance to some sort of standard. It's just that the spacing algorithms are kind of "naive" and really doesn't have any concept of how to deviate from the normal "regular" note spacing except in the specific cases where support for some particular exception happens to be built in. There might be plenty of places where standard conventions allow for irregular spacing but we don't currently handle those cases. From what I understand @wschweer is working on further improvements to the basic note spacing algorithms.

@shoogle
Copy link
Contributor

shoogle commented Oct 3, 2015

Very interesting, thanks for elaborating. I reckon I know MuseScore pretty well by most people's standards, but this just goes to show how much there is still to learn!

This patch gives better control on lyrics dash management and it is intended to supersede #2213 which did not suit the taste of several forum users; for a discussion, see https://musescore.org/en/node/76021 .

Adds 3 new score style parameters:
- `lyricsDashMinLength` to control the minimum dash length (default: 0.4sp)
- `lyricsDashMaxLength` to control the maximum dash length (default: 0.8sp)
- `lyricsDashForce`: if set to __true__, a dash is always generated between two syllables of a word and, if there is not enough space for the min dash length, more space is added between the syllables to accommodate it; if set to __false__, no extra space is added and the two syllables are joined together (default: true)

The effect of the last parameter is exemplified by the following screen-shots:

Current situation (before this patch); if there is no room for the min dash length, the dash is skipped and some blank is left between syllables:

Patch with `lyricsDashForce = true`; chords are further spaced and a min-length dash is inserted:

Patch with `lyricsDashForce = false`: the second syllable is moved (slightly) to the left to reclaim the blank:
@mgavioli mgavioli changed the title Lyrics: Better dash control - WORK IN PROGRESS Lyrics: Better dash control Oct 3, 2015
@mgavioli
Copy link
Contributor Author

mgavioli commented Oct 3, 2015

UI added. I believe the PR to be ready for merging and wider testing, including fine tuning default values of min / max dash lengths.

wschweer added a commit that referenced this pull request Oct 27, 2015
@wschweer wschweer merged commit 5c5f5e7 into musescore:master Oct 27, 2015
@mgavioli
Copy link
Contributor Author

@lasconic @wschweer : Possibly a good candidate for 2.0.3 merging too? The only change which can be 'seen from outside' (from a non-2.0.3 MuseScore version) are the 3 additional score style parameters and they would be ignored by 2.0.2, wouldn't they?

Incidentally, I didn't find an easy way to check if a specific PR has been merged to 2.0.3 or not, beyond manually browsing the 2.0.3 list of commits; apparently, there is no indication of this in the PR page itself. Did I overlook something?

@Jojo-Schmitz
Copy link
Contributor

It is far easier to track if there is a corresponding issue in the issue tracker and the commit message used the proper format

@lasconic
Copy link
Contributor

Hi,

the 3 additional score style parameters
Unfortunately an unknown style parameter crashes MuseScore 2.0.x...
It has been fixed for 2.0.2 only 8c6a953

To know if a commit has been merged in 2.0.3

git checkout 2.0.3
git log --grep "commit message"

@Jojo-Schmitz
Copy link
Contributor

So we can't merge this into 2.0.3 to maintain compatibility with 2.0 and 2.0.2, right?
Unless we bump up the file format version and that way inform users that they'd need to upgrade...

@mgavioli mgavioli deleted the LYRICS_Better_dash_control branch November 13, 2015 09:33
@mgavioli
Copy link
Contributor Author

Ok, I understand, tough luck for the 3 parameters...

About commit checking, I hoped for a way to see this through github itself, to avoid void checking 2.0.3 in and then out, triggering a big recompile each time. But never mind, I managed to do what I was after. Thanks anyway!

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.

6 participants