lilypond-user
[Top][All Lists]
Advanced

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

Re: \partial only on first measure?


From: David Kastrup
Subject: Re: \partial only on first measure?
Date: Wed, 28 Sep 2011 10:04:22 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Jan-Peter Voigt <address@hidden> writes:

> in lilypond you achieve less typing with defining music-funtions:
>
> --snip--
> partialInline = #(define-music-function (parser location nom den
> mus)(integer? integer? ly:music?)
>   #{
>     \set Timing.measureLength = #(ly:make-moment $nom $den)
>     $mus
>     \unset Timing.measureLength
> #})
>
> \relative c' {
>   \time 4/4
>   \partial 4
>   \repeat volta 2 { c4 | e g a } \alternative {
>     { b | c b a } { \partialInline #1 #4 b | a g f }
>   }
>   c8 d | c1 |
> }

With the current development version, you can write this as

partialInline = #(define-music-function (parser location dur mus)
(ly:duration? ly:music?)
  #{
    \set Timing.measureLength = $dur
    $mus
    \unset Timing.measureLength % Sure you need to unset?!?
#})

\relative c' {
  \time 4/4
  \partial 4
  \repeat volta 2 { c4 | e g a } \alternative {
    { b | c b a } { \partialInline 4 b | a g f }
  }
  c8 d | c1 |
}

-- 
David Kastrup




reply via email to

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