lilypond-user
[Top][All Lists]
Advanced

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

Re: How to get Timing.measureLength from within Scheme?


From: Alberto Simões
Subject: Re: How to get Timing.measureLength from within Scheme?
Date: Wed, 28 Sep 2011 16:09:28 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:6.0.2) Gecko/20110902 Thunderbird/6.0.2



On 28/09/2011 16:04, Dmytro O. Redchuk wrote:
On Wed 28 Sep 2011, 15:49 Alberto Simões wrote:
Hello

I am trying to save Timing.measureLength in a little music function,
but I am unable to find examples in the web of how to get that value
(only how to set).

My try (ok, most of the code was suggested by Jan-Peter), is something like:

partialInline = #(define-music-function (parser location nom den
mus)(integer? integer? ly:music?)
   #{
     #(def tmp (get Timing.measureLength))
     $mus
     \set Timing.measureLength = tmp
#})


but, how to write the (get ..) portion?
I am sorry, why not to use documented Score.measurePosition?

%------------8<-------------------
partialInline =
  #(define-music-function (parser location nom den mus)
       (integer? integer? ly:music?)
   #{
     \set Score.measurePosition = #(ly:make-moment $nom $den)
     $mus
   #})

Similar :)

partialInline = #(define-music-function
     (parser location nom den mus)
     (integer? integer? ly:music?)
  #{
    \set Score.measurePosition = #(ly:make-moment (- $nom) $den)
    $mus
   #}
)

Thanks!

--
Alberto Simoes
CEHUM



reply via email to

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