openlilylib / snippets

A place to store useful pieces of LilyPond code - custom functions, engravers, hacks, templates, examples etc.
Other
119 stars 39 forks source link

gridly: Properly handle opening and lyrics in gridCompileCell #113

Closed uliska closed 9 years ago

uliska commented 9 years ago

When a cell has lyrics and some content in opening the lyrics are wrongly assigned when using \gridCompileCell or when the cell is the first of a range (i.e. they are assigned as starting with the opening).

I don't know how to approach this concretely. Basically one would either have to make the lyrics attachment start only with the cell's content, add a way to also add lyrics to the opening or add a skip of the opening's length to the returned lyrics. I think the last one seems the most straightforward and clean approach, but one would have to take care about what happens when there is a hyphenation at the border between opening and content.

Cecca commented 9 years ago

Can you please point me to a file affected by this issue? In the combined usage of lyrics and openings I've done so far everything worked quite well

uliska commented 9 years ago
\version "2.19.18"

\include "openlilylib"
\useLibrary "gridly"

\gridInit 1 #'("voice")

\gridPutMusic "voice" 1 \with {
  opening = { c'1 }
  lyrics = \lyricmode { Test }
}
{ \mark \default
  c'1 ^\markup { The lyrics are starting with the note from the opening }
}

\gridCompileCell "voice" 1
uliska commented 9 years ago

Or the constellation with tied music. This doesn't make a difference for the example, but maybe for a solution:

\gridPutMusic "voice" 2 \with {
  opening = { c'1 ~ }
  lyrics = \lyricmode { Test }
}
{ \mark \default
  c'2 c' ^\markup { The lyrics are starting with the note from the opening }
}
Cecca commented 9 years ago

OK, I understand. This is something I never encountered because I don't put any notes in the opening. I assume that if you put some notes in the opening it is because the opening is like an "overlapping zone" with the preceding cell. So, in your second example, thy lyrics "test" should be assigned to the second c in the music body and the lyrics for the c in the opening are defined in cell 1, right?

Adding a skip to the lyrics won't work for the second example you made, because in that case the word "test" would be aligned to the first c in the music body. So it seems that we should have a way to explicitly add lyrics to the opening, like a opening-lyrics option for the with block.

uliska commented 9 years ago

Your assumptions on the use-case are correct (that's where I've encountered the issue).

It would be nicer if we could determine the skip, but of course this doesn't only affect tied notes (which might be possible to detect) but also slurred or beamed ones (and maybe other constellations). So probably yes, we need an additional field.

Cecca commented 9 years ago

I opened a PR with the implementation of opening and closing lyrics. See the example file. Please let me know if this fixes your problems.

I have a close deadline, so in the next two weeks I will not be much responsive.