[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: How to get Timing.measureLength from within Scheme?
From: |
Dmytro O. Redchuk |
Subject: |
Re: How to get Timing.measureLength from within Scheme? |
Date: |
Wed, 28 Sep 2011 18:04:34 +0300 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
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
#})
\relative c'' {
c2 c
\partialInline #-1 #4 { c4 }
c1
}
%------------8<-------------------
Really sorry, i could miss-n-mess something.
--
Dmytro O. Redchuk "Easy to use" is easy to say.
Bug Squad -- Jeff Garbers