Sorry, yes I did copy yours because the original one had some kind of formatting problem and I thought that yours was just a reformatting of the original.
Thanks, On Sat, May 16, 2020, 3:30 AM David Kastrup <d...@gnu.org> wrote: > Flaming Hakama by Elaine <ela...@flaminghakama.com> writes: > > >> From: Klaus Blum <benbigno...@gmx.de> > >> To: "lilypond-user@gnu.org" <lilypond-user@gnu.org> > >> Cc: > >> Bcc: > >> Date: Fri, 15 May 2020 12:01:06 +0200 > >> Subject: Current octave in relative mode > >> 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) > >> > >> > >> % ---------------------------------------- > >> 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 > >> } > >> } > >> % ---------------------------------------- > > > I'm not quite sure what you are after here, except that some things are > not > > in the octave you want, but I'm not sure which. > > > > [...] > > > So, in your example, if all the c1's are supposed to be the same octave > > this is accomplished by just specifying each of the ones you pass to your > > function. > > > > > > \version "2.19.81" > > % ---------------------------------------- > > highlight = > > #(define-music-function (mus) > > (ly:music?) > > (make-relative (mus) mus > > #{ > > << > > $mus > > \makeClusters $mus > > >> > > #})) > > You are aware that make-relative here fixes the problem? Did you just > copy the fixed version by accident from my reply? > > -- > David Kastrup >