[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Multimeasure rests over a cadenza
From: |
Thomas Morley |
Subject: |
Re: Multimeasure rests over a cadenza |
Date: |
Mon, 9 Apr 2012 12:03:05 +0200 |
Am 9. April 2012 04:26 schrieb James Harkins <address@hidden>:
> 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.
Hi James,
the cadenzaToMusic-function _replaces_ \cadenzaOn and \cadenzaOff.
If you delete these commands it works and there is no need for manual bars:
\version "2.14.2"
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
#}))
\include "english.ly"
cadenzaC = \relative c''' {
b2 ^\markup { \italic "cadenza" } ~
\oneVoice b8 \fermata [a8] ) e'16 ( [a, fs a] \voiceOne b4 \fermata ~
}
cadenzaD = \relative c''' {
b4 ~ ^\markup { \italic "cadenza" } b8 \fermata [a8] ) g16 ( [fs e d
e fs ] e4 ) \fermata ~
}
\score {
<<
\new Staff {
\override Score.BarNumber #'break-visibility = #'#(#t #t #t)
\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
}
>>
}
HTH,
Harm