lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Override note properties in markup,note or rhythm


From: Jean Abou Samra
Subject: Re: Override note properties in markup,note or rhythm
Date: Sat, 21 Jan 2023 23:57:41 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 21/01/2023 à 17:26, | || | | a écrit :
Hiya!

I'm trying to find a gentle solution for the problem I encountered.

I overrided flag stencil in general Score, but it turns out that this doesn't influence notes in \tempo, \note and \rhythm functions. I there a possibility to influence those ones?

I add that I know I could construct note from the beginning inside markup and add hidden tempo change for proper tempo export, but it seems to be overkill for this kind of problem.


That overrides in the main music do not influence \tempo,
\note or \rhythm is intentional. However, \rhythm has more
flexibility than \note because you can just put overrides
inside it, like

\version "2.24.0"

customFlag = {
  \override Score.Flag.stencil = #ly:text-interface::print
  \override Score.Flag.text = \markup {\raise #-0.2 \beam #1.0 #0.05 #0.5 }
}

\score {
  \new Staff {
    \overrideTimeSignatureSettings 4/4 1/8 #'() #'()
    \time 4/4
    \customFlag
    \tempo \markup { Mechanical (\fontsize #-1 \rhythm { \customFlag 8 } \hspace #-0.6 = 92 )}
    c'8 8 8 8 8 8 8 8
    c'8 8 8 8 8 8 8 8
  }
}


It's also possible to do that globally with

\version "2.24.0"

customFlag = {
  \override Score.Flag.stencil = #ly:text-interface::print
  \override Score.Flag.text = \markup {\raise #-0.2 \beam #1.0 #0.05 #0.5 }
}

\layout {
  \context {
    \Score
    \customFlag
  }
  \context {
    \StandaloneRhythmScore
    \customFlag
  }
}

\score {
  \new Staff {
    \overrideTimeSignatureSettings 4/4 1/8 #'() #'()
    \time 4/4
    \tempo \markup { Mechanical (\fontsize #-1 \rhythm { { 8 } } \hspace #-0.6 = 92 )}
    c'8 8 8 8 8 8 8 8
    c'8 8 8 8 8 8 8 8
  }
}


(Note the necessary extra braces in \rhythm { { 8 } }; this quirk has
already been solved, in the unstable version 2.25.0.)

Unfortunately, \tempo internally uses \note, which does not have the
same sort of customizability. You can use tags, though:

\version "2.24.0"

customFlag = {
  \override Score.Flag.stencil = #ly:text-interface::print
  \override Score.Flag.text = \markup {\raise #-0.2 \beam #1.0 #0.05 #0.5 }
}

\layout {
  \context {
    \Score
    \customFlag
  }
  \context {
    \StandaloneRhythmScore
    \customFlag
  }
}

\tagGroup midi,layout

mus =
\new Staff {
  \overrideTimeSignatureSettings 4/4 1/8 #'() #'()
  \time 4/4
  \tag layout \tempo \markup { Mechanical (\fontsize #-1 \rhythm { { 8 } } \hspace #-0.6 = 92 )}
  \tag midi \tempo 8 = 92
  c'8 8 8 8 8 8 8 8
  c'8 8 8 8 8 8 8 8
}


\score {
  \keepWithTag layout \mus
  \layout { }
}

\score {
  \keepWithTag midi \mus
  \midi { }
}



Best,
Jean




Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]