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

Finer control on notes-text spacing #1125

Closed
eroux opened this issue May 26, 2016 · 19 comments
Closed

Finer control on notes-text spacing #1125

eroux opened this issue May 26, 2016 · 19 comments
Assignees
Milestone

Comments

@eroux
Copy link
Contributor

eroux commented May 26, 2016

In some cases, a short spacelinestext should make d pitch considered as a low note adding space between notes and text.

See the following example

\documentclass[11pt]{article} %%
\usepackage{fontspec} %%
\usepackage{gregoriotex} %%
\begin{document} %%

% espace au-dessus des lignes
\grechangedim{spaceabovelines}{0.429 cm plus 0.286 cm minus 0.0715 cm}{scalable}%
%the space between the lines and the bottom of the text
\grechangedim{spacelinestext}{0.32 cm}{scalable}%

\gabcsnippet{%
(c4)
Mys(e)té(gh)ri(h)um(hg) fí(h!iwjh)de(gh)i.(h) Vel:(::) Mys(e)té(gh)ri(h)um(h) fí(i)de(h)i.(h) (::Z)
<sp>R/</sp> Mor<alt>Omnes:</alt>(e)tem(g) tu(gh)am(h) an(h)nun(h)ti(h)á(h)mus,(g) Dó(h!iwj)mi(h)ne,(h) (;) et(e) tu(gh)am(h) re(h)sur(h)rec(h)ti(h)ó(h)nem(h) con(i)fi(h)té(gh)mur,(g) (,) do(hf)nec(gg) vé(e)ni(de)as.(e) (::) (g+)
}%
\end{document}

in which the i merges within the podatus. Of course this example is a bit extreme, but I think having a system similar to what's happening at the top of the staff with (additionaltopspacealtthreshold) would fix this issue...

@henryso henryso added this to the 5.0 milestone May 29, 2016
@henryso
Copy link
Contributor

henryso commented Jan 14, 2017

There is a request to try to get this specifically into 5.0, so if everyone else is busy, maybe someone can give me pointers to "what's happening at the top of the staff", so I can try to look into this?

@eroux
Copy link
Contributor Author

eroux commented Jan 14, 2017

I think the important description is this one. What I remember is that you can define a threshold above which notes will start to move the space above staff lines, if you set it high, no note will change the above staff line space, whatever its height; if you set it to 0, this means that k (or j, can't remember) will start making the space above staff lines bigger. There should be a similar mechanism for the space between the staff lines and the text. Note that it will possibly be more difficult because the different stem length have to be taken into account... Also, the amount of space it difference with the threshold will add on the spacing should be settable. For instance you should be able to say "all notes below c will add 2mm", something like that... do you see what I mean?

@henryso
Copy link
Contributor

henryso commented Jan 15, 2017

Should the space be based on the number of notes before the threshold (e.g., a adds 4 mm and b adds 2 mm) or is the space just added (e.g., a or b just adds 2 mm).

@eroux
Copy link
Contributor Author

eroux commented Jan 15, 2017

First option. Also, it would be great if the variables can be tuned per-line. there are a few cases in the italian Antiphonale where the custos is relatively far from the text (horizontally) but is the only very low note (a) of the line. In these cases users should be able to say "don't take the custos into account on the first line", by just making the threshold value 99 for this line... do you see what I mean? Also, sorry for the lack of involvement, I'm starting a new job tomorrow and I ended the current one on Friday, so there's quite a lot going on...

@henryso
Copy link
Contributor

henryso commented Jan 15, 2017

Note: while I am looking into this, things are slow going as I experiment with stuff. If anyone has the time and inclination to take this on, please feel free.

@henryso
Copy link
Contributor

henryso commented Jan 16, 2017

What should the default be? "all notes below c will add 2mm"?

@henryso henryso self-assigned this Jan 16, 2017
@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

I think it should be all notes below c will add half of the space between staff lines...

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

Maybe it's because I'm misunderstanding what should be done, but given the other spaces, I think half the space between staff lines (which is almost 3 mm with a grefactor of 17) is rather excessive.

image

In this screenshot, the lowest pitch on the top staff is a, so about 6 mm of space (i.e., the space between staff lines) is added. The bottom staff (where no extra space is added) is there for comparison's sake.

Is this what is desired?

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

Here's how it looks with the feature disabled (by setting the threshold appropriately):

image

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

Hmmm, it looks like you're modifying the wrong space here... the space that should be set is the space between the baseline of the text and the bottom staff line (the one on d).

In your pictures, the space between lines is 10px, half is 5px. The base value of the space according to the second line is 23px. So this means that on the first line, the space should be 23+3x5=38px, while in your image it's 57px... do you see what I mean?

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

Yes, looking at these pictures this way, it's more obvious that I'm doing something wrong. I'll keep banging my head against it.

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

I think the problem is that the modification of the space looks applied twice: in your second post, when you disable the feature, it seems the space is modified anyway... ?

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

No, when disabled, that picture matches the old expectation from that test.

Looking at the code, I think I am double counting \gre@pitch@a.

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

Hmm, yes, but that feature should replace the current modification of the space, not add another modification on top of it!

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

it's just a more convenient way to tune this spacing (and it's necessary for correctly tuning it), it's not really something new...

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

Ok, that was totally unclear from the opening post. I'll see if I can figure out how to do that.

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

Sorry, I didn't realize it could be interpreted another way! Basically I think the calculation already more or less does this (add half the space between staff lines for each note beneath d), the feature is just to add a way to tune the threshold and the value

@henryso
Copy link
Contributor

henryso commented Jan 17, 2017

Ok, then the current calculation is 15750 sp * the number of pitches below c, which I guess this shall be the default.

And this issue is actually requesting that "15750 sp" and "the number of pitches below c" be configurable, correct?

@eroux
Copy link
Contributor Author

eroux commented Jan 17, 2017

yes

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

No branches or pull requests

2 participants