There's a function Han Wen wrote for me years ago, that's made its way in to standard lilypond. It's probably mentioned in the docu about relative mode. Something along the lines of

      c1  \highlight { c8 d e f g f e d }
      \setAbsoluteOctave ...
      c1  \highlight { c8 d e f g a b c }

Don't quote me on the function name though ... (I needed it for Pennsylvania 6-5-0-0-0

Cheers,
Wol

On 15/05/2020 11:01, Klaus Blum wrote:
Hi,

I have a function that uses a music expression twice.
My problem is:
In relative mode, this expression can lead into a different octave. Then
the second application of the music expression starts from that new octave.
(See the last two invocations of "\highlight" in the example below)

Is there something I can do INSIDE my function to prevent this? E.g.
storing and re-applying the current octave? Thanks for any hint.  :)


% ----------------------------------------
highlight =
#(define-music-function (mus)
    (ly:music?)
    #{
      <<
        $mus
        \makeClusters $mus
      >>
    #})

\new Staff {
   \highlight { c'8 d' e' f' g' a' b' c'' }
   \relative c' {
     c1  \highlight { c8 d e f g f e d }
     c1  \highlight { c8 d e f g a b c }
     c1  \highlight { f,4 e d c }
     c1
   }
}
% ----------------------------------------

Cheers,
Klaus


Reply via email to