lilypond-user
[Top][All Lists]
Advanced

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

Re: [Question] How to increment the current bar number


From: Malte Meyn
Subject: Re: [Question] How to increment the current bar number
Date: Sun, 2 Sep 2018 21:26:51 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.0



Am 02.09.18 um 21:21 schrieb Torsten Hämmerle:
How about using ly:context-property-where-defined?
As in:


%%%%%%%%%%%%%%%
\version "2.19.82"

increaseBarNumber =
#(define-music-function (par loc addm) (integer?)
    (make-apply-context
     (lambda (context)
       (let* ((where (ly:context-property-where-defined context
'currentBarNumber))
              (cbn (ly:context-property where 'currentBarNumber)))
         (ly:context-set-property! where 'currentBarNumber (+ addm cbn))))))

Again what learned ;)

But does this have any advantage over ly:context-find 'Score/'Timing/'whatever if I already know that the context property I want to change lives in Score/Timing/whatever?



reply via email to

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