Color of hyphens when LyricText color is changed with override command

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Color of hyphens when LyricText color is changed with override command

Colin Tennyson
In a score that I am preparing I have used the following command to change the color of the LyricText element:

\override Lyrics.LyricText.color = #grey  

I noticed that the hyphens in the LyricText were still black.

It occurred to me that maybe the color of the hyphens has to be set separately. I started typing '\override Lyrics.Hyphen.color'  but Frescobaldi's syntax highlighting didn't process that, so I skipped trying to compilie that, and I tried:

\override Lyrics.LyricText.LyricHyphen.color = #grey

Frescobaldi syntax highlighting did process that, and sure enough that command was accepted by the Lilypond score compiler. Yay!  
(And hurray for Frescobaldi!)


My question is out of sheer curiosity:
How did this situation come about?
Surely the hyphens in the lyrics are part of the LyricText.
Why is the color of the hyphens a separate override?


Colin Tennyson
Reply | Threaded
Open this post in threaded view
|

Re: Color of hyphens when LyricText color is changed with override command

Schneidy
Hi Colin,

...
> Surely the hyphens in the lyrics are part of the LyricText.
...

Are they?
Have you tried: \override Lyrics.LyricHyphen.color = #grey ?

Cheers,
Pierre



2016-09-18 14:29 GMT+02:00 Colin Tennyson <[hidden email]>:
In a score that I am preparing I have used the following command to change
the color of the LyricText element:

\override Lyrics.LyricText.color = #grey

I noticed that the hyphens in the LyricText were still black.

It occurred to me that maybe the color of the hyphens has to be set
separately. I started typing '\override Lyrics.Hyphen.color'  but
Frescobaldi's syntax highlighting didn't process that, so I skipped trying
to compilie that, and I tried:

\override Lyrics.LyricText.LyricHyphen.color = #grey

Frescobaldi syntax highlighting did process that, and sure enough that
command was accepted by the Lilypond score compiler. Yay!
(And hurray for Frescobaldi!)


My question is out of sheer curiosity:
How did this situation come about?
Surely the hyphens in the lyrics are part of the LyricText.
Why is the color of the hyphens a separate override?


Colin Tennyson




--
View this message in context: http://lilypond.1069038.n5.nabble.com/Color-of-hyphens-when-LyricText-color-is-changed-with-override-command-tp194692.html
Sent from the User mailing list archive at Nabble.com.

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Color of hyphens when LyricText color is changed with override command

David Kastrup
In reply to this post by Colin Tennyson
Colin Tennyson <[hidden email]> writes:

> In a score that I am preparing I have used the following command to change
> the color of the LyricText element:
>
> \override Lyrics.LyricText.color = #grey  
>
> I noticed that the hyphens in the LyricText were still black.
>
> It occurred to me that maybe the color of the hyphens has to be set
> separately. I started typing '\override Lyrics.Hyphen.color'  but
> Frescobaldi's syntax highlighting didn't process that, so I skipped trying
> to compilie that, and I tried:
>
> \override Lyrics.LyricText.LyricHyphen.color = #grey
>
> Frescobaldi syntax highlighting did process that, and sure enough that
> command was accepted by the Lilypond score compiler. Yay!  
> (And hurray for Frescobaldi!)
>
>
> My question is out of sheer curiosity:
> How did this situation come about?
> Surely the hyphens in the lyrics are part of the LyricText.

No?

> Why is the color of the hyphens a separate override?

Because lyric hyphens are a different type of grob?  They are variable
in size and can shrink to nothing, and they are not considered part of a
syllable with regard to aligning to notes.

Since their behavior differs from that of LyricText, they are
implemented as a separate grob.  An override changes the actual defaults
with which grobs are created.  Those defaults are not really stored in a
database consulted independently (full disclosure: LilyPond code
actually _does_ contain this sort of database lookup independently from
actual grob creation for the grob types "System", "Beam", "SpanBarStub"
but those are very much the exception rather than the rule) but only as
defaults in the process of grob creation.

Different grob type, different override.

--
David Kastrup

_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Color of hyphens when LyricText color is changed with override command

Kieren MacMillan
In reply to this post by Colin Tennyson
Hi Colin,

> How did this situation come about?

The need for granular control of all graphical elements in a score, I would assume.

> Surely the hyphens in the lyrics are part of the LyricText.

Not really… they are part of the PRESENTATION of the lyric text (a.k.a. LyricText). They are, however, part of the Lyrics — and that may be what you’re alluding to.

> Why is the color of the hyphens a separate override?

The same reason as holds for LyricExtender as well: text, hyphen, and extender are all different parts of the presentation of lyrics (see second line in the attached snippet). Note also that this distinction holds for ANY override (extra-offset, transparent, etc.).

Now… More to your implicit point: there probably SHOULD be some syntactic sugar which would override all aspects of Lyrics in a single setting, e.g.

    \override Lyrics.color = #red
    \override Lyrics.extra-offset = #’(0 . 2)
    etc.

This can be done easily with a music function (e.g., snippet below)… but there’s probably a better, more comprehensive, and less fragile (read: more future-proof) way, with perhaps an interface similar to the pseudo-code above.

Hope this helps!
Kieren.

%%%  SNIPPET BEGINS
\version "2.19.46"

\paper {
  ragged-right = ##f
  indent = 0
  system-system-spacing.padding = #18
}

lyrEOBegin =
  #(define-music-function (parser location xo) (pair?)
    #{
      \temporary \override LyricText.extra-offset = $xo
      \temporary \override LyricHyphen.extra-offset = $xo
      \temporary \override LyricExtender.extra-offset = $xo
    #})

lyrEOEnd = {
  \revert LyricText.extra-offset
  \revert LyricHyphen.extra-offset
  \revert LyricExtender.extra-offset
}

eo-test-notes = {
  \omit Score.TimeSignature
  \time 3/4
  c'4 d'( e')
  f'4( g') a'
  b'2 g'4
  c''2. \break
}

eo-test-lyrics = \lyricmode {
  Test -- ing, __ test -- ing, one, two, three!
  \temporary \override LyricText.extra-offset = #'(0 . 2)
  Test -- ing, __ test -- ing, one, two, three!
  \revert LyricText.extra-offset
  \lyrEOBegin #'(0 . 2)
  Test -- ing, __ test -- ing, one, two, three!
  \lyrEOEnd
  Test -- ing, __ test -- ing, one, two, three!
}

\score {
  <<
    \new Staff \new Voice { \repeat unfold 4 \eo-test-notes \bar "|." }
    \addlyrics \eo-test-lyrics
  >>
}
%%%  SNIPPET ENDS
________________________________

Kieren MacMillan, composer
‣ website: www.kierenmacmillan.info
‣ email: [hidden email]


_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
Reply | Threaded
Open this post in threaded view
|

Re: Color of hyphens when LyricText color is changed with override command

Colin Tennyson
Kieren MacMillan wrote:

> need for granular control of all graphical elements in a score, I would assume.
> [...]
> text, hyphen, and extender are all different
> parts of the presentation of lyrics [...]. Note also that this
> distinction holds for ANY override (extra-offset, transparent, etc.).

> Now… More to your implicit point: there probably SHOULD be some syntactic sugar which would
> override all aspects of Lyrics in a single setting [...]

Hi Kieren,

thanks for your clarification.

I hadn't appreciated the point that David Kastrup mentions: the LyricHyphen and LyricExtender are different in the sense that their engraving is conditional; if space is available hyphens are inserted, if insufficient space is available hyphens are omitted. So hyphens must be processed somewhat separately, which I guess explains why they are commanded separately.

For the particular score I'm working on the lyrics are to be in grey throughout, so I just inserted those overrides in the block of layout declarations.

If I would have to toggle between black and grey lyrics several times I would declare the following two variables:

lyricsGrey = {
\override LyricText.color = #grey
\override LyricText.LyricHyphen.color = #grey
}

lyricsRevert = {
\revert LyricText.color
\revert LyricText.LyricHyphen.color
}

And then insert those inside the lyricmode sections as needed.


Also, thanks for the discussion of using a music function, as a glimpse of what is possible.
(In my case, given my level of experience, I don't see myself attempting the use of Lilypond music function in the foreseeable future.)


Colin Tennyson