lilypond-user
[Top][All Lists]
Advanced

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

Re: Multimeasure rests over a cadenza


From: James Harkins
Subject: Re: Multimeasure rests over a cadenza
Date: Mon, 09 Apr 2012 10:26:23 +0800
User-agent: Wanderlust/2.15.6 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (Gojō) APEL/10.7 Emacs/23.1 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO)

At Sun, 8 Apr 2012 09:39:13 -0500,
David Nalesnik wrote:
> Hi James,
> Possibly the following thread will be useful to you:
>  http://www.mail-archive.com/address@hidden/msg68492.html

Thanks, this is a lot closer. (By the way, it seems that mail-archive is on the 
wrong side of the Great Firewall of China -- not a big deal, but it did make it 
less convenient to access the link. Speaking just for myself, I'd prefer links 
to gmane or nabble archives.)

It's "closer" -- I'm now getting bar check failures only at the ends of the two 
cadenzas, where I think I was getting more of them before. But, it's still 
failing and the multi-measure rests are drawn in the wrong place.

So, a more illustrative example, using actual notes from my piece and 
replicating the context (one bar of cadenza, one metered bar, and another bar 
of cadenza).

It looks to me like time advances the correct number of beats, but LP doesn't 
recognize that it should roll over to the next bar at that point. I'm guessing 
that for each cadenza + following-bar pair, where there should be two full-bar 
rests, only one is being drawn (probably the first one, for the cadenza) and 
the other one is being dropped because of the bar check failure. Then it draws 
the single full-bar rest in the middle of the span for /both/ bars.

It doesn't help to include an explicit \bar "|" after the \cadenzaToMusic calls.

LP output. For debugging I restored the (format...) call, which shows that the 
duration of both cadenzas is being calculated correctly.

Parsing...factor : #<Mom 5/4>
factor : #<Mom 9/8>

Interpreting music... 
<string>:2:32: warning: barcheck failed at: 5/4
    \set Timing.measureLength = 
                                \lilyvartmpbg
<string>:2:32: warning: barcheck failed at: 9/8
    \set Timing.measureLength = 
                                \lilyvartmpbg
Preprocessing graphical objects...
Finding the ideal number of pages...
Fitting music on 1 page...
Drawing systems...

Thanks,
James


\version "2.14.2"
\include "english.ly"

cadenzaToMusic =
#(define-music-function (parser location cadenzaMusic music)
                                                  (ly:music? ly:music?)
"Adjust the length of `music and the measureLength, to fit the length of
`cadenzaMusic"
(let* ((clen (ly:music-length cadenzaMusic))
       (mlen (ly:music-length music))
       (factor (ly:moment-div clen mlen))
       (compressed (ly:music-compress music factor)))
   (format #t "factor : ~a\n" factor)
  #{
    \set Timing.measureLength = $clen
    $compressed
    \unset Timing.measureLength
  #}))

cadenzaC = \relative c''' {
  \cadenzaOn
  b2 ^\markup { \italic "cadenza" } ~ 
  \oneVoice b8 \fermata [a8] ) e'16 ( [a, fs a] \voiceOne b4 \fermata ~
  \cadenzaOff \bar "|"
}

cadenzaD = \relative c''' {
  \cadenzaOn
  b4 ~ ^\markup { \italic "cadenza" } b8 \fermata [a8] ) g16 ( [fs e d e fs ] 
e4 ) \fermata ~
  \cadenzaOff \bar "|"
}

\score {
  <<
    \new Staff {
      \key d \major \numericTimeSignature
      R1
      \cadenzaToMusic \cadenzaC R1
      R1
      \cadenzaToMusic \cadenzaD R1
      R1
    }
    \new Staff \relative c''' {
      \key d \major \numericTimeSignature
      r2 r4 a4 (
      \cadenzaC
      b1 ~
      \cadenzaD
      e,4. r8 r2
    }
  >>
}


--
James Harkins /// dewdrop world
address@hidden
http://www.dewdrop-world.net

"Come said the Muse,
Sing me a song no poet has yet chanted,
Sing me the universal."  -- Whitman

blog: http://www.dewdrop-world.net/words
audio clips: http://www.dewdrop-world.net/audio
more audio: http://soundcloud.com/dewdrop_world/tracks



reply via email to

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