[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: printing the current moment in a context
From: |
David Kastrup |
Subject: |
Re: printing the current moment in a context |
Date: |
Wed, 16 Aug 2017 11:47:08 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) |
Kieren MacMillan <address@hidden> writes:
> Hi all,
>
> Is there a function (2.19.64) that will output the current context
> moment (e.g., measure number and beat) as markup?
> In my polymetric scores, I need to target moments (using the
> edition-engraver), and it currently involves a bit too much
> trial-and-error…
Something like
#(define (moment->string mom)
(if (zero? (ly:moment-grace mom))
(number->string (ly:moment-main mom))
(format "~sG~a" (ly:moment-main mom) (ly:moment-grace mom))))
currentmom =
-\tweak text
#(lambda (grob)
(let* ((loc (grob::rhythmic-location grob)))
(if (pair? loc)
#{ \markup \with-color #red #(format "address@hidden" (car loc)
(moment->string (cdr loc))) #}
"")))
-""
{ c d\currentmom f g }
I would have used rhythmic-location->string but it relies on
ly:moment->string that never ever was defined over the history of
LilyPond. Cough cough.
--
David Kastrup
- printing the current moment in a context, Kieren MacMillan, 2017/08/16
- Re: printing the current moment in a context,
David Kastrup <=
- Re: printing the current moment in a context, Kieren MacMillan, 2017/08/16
- Re: printing the current moment in a context, David Kastrup, 2017/08/16
- Re: printing the current moment in a context, Francisco Vila, 2017/08/16
- Re: printing the current moment in a context, David Kastrup, 2017/08/16
- Re: printing the current moment in a context, Kieren MacMillan, 2017/08/17
- Re: printing the current moment in a context, Jan-Peter Voigt, 2017/08/18
- Re: printing the current moment in a context, David Kastrup, 2017/08/18
- Re: printing the current moment in a context, Jan-Peter Voigt, 2017/08/18
- Re: printing the current moment in a context, Kieren MacMillan, 2017/08/18
- Re: printing the current moment in a context, Kieren MacMillan, 2017/08/18