Am 20.03.2013 02:16, schrieb David Kastrup:
Kieren MacMillan <kieren_macmil...@sympatico.ca> writes:
Hi Shane,
What happens when we need an awkward length R like R1*12/8*14?
I'm not sure what you mean by "awkward length"…
I'm suggesting that R (with no duration given) should give you a
one-measure multi-measure rest, regardless of what the measure
duration is.
I just realized that the total musical length of music expressions is
established _before_ iteration (and some manipulations require it to be
known), while the varying measure length is established by properties
set _during_ iteration.
So whatever the syntax: no can do. Surprising as that may seem.
This sound reasonable and is what I came across, when trying to deal
with this myself ... well, I wasn't sure, if I was right ...
So I know I have to know the measure length before creating my
full-measure rests - I created a few functions (taktSkip/Rest/Meta).
There were a lot pieces of music with frequently alternating time
signatures. I mostly use { \taktMeta 3/4 5 } in my global part, to
create (in this example) 5 measures of 3/4. The function combines the
creation of the time signature and the skip event. To create rests in
music, nowadays I prefer { R1*3/4*5 }. It is still shorter than {
\taktRest 3/4 5 }
Cheers,
Jan-Peter
\version "2.16.1"
% skip count measures of signature frac
taktSkip =
#(define-music-function (parser location frac count)(fraction? integer?)
(let ((nom (car frac))
(den (cdr frac)))
(make-music
'SkipEvent
'duration
(ly:make-duration (inexact->exact (/ (log den)(log 2))) 0 (* nom count) 1))))
% rest count measures of signature frac
taktRest =
#(define-music-function (parser location frac count)(fraction? integer?)
(let ((nom (car frac))
(den (cdr frac)))
(make-music
'MultiMeasureRestMusic
'duration
(ly:make-duration (inexact->exact (/ (log den)(log 2))) 0 (* nom count) 1))))
% create time signature and then skip count measures of signature frac
taktMeta =
#(define-music-function (parser location frac count)(fraction? integer?)
(let ((nom (car frac))
(den (cdr frac)))
(make-music 'SequentialMusic
'elements (list
(make-music 'TimeSignatureMusic
'beat-structure '()
'denominator den
'numerator nom)
(make-music
'SkipEvent
'duration
(ly:make-duration (inexact->exact (/ (log den)(log 2))) 0 (* nom count) 1))
))))
% example
\new Staff <<
% global/meta part: 9 measures of 5/8
{ \taktMeta 5/8 3 \bar "||" \taktMeta 3/4 6 \bar "|." }
% the music: here just rests and skips
{
\taktRest 5/8 3
\taktRest 3/4 2
<< { \taktSkip 3/4 2 } { s4^"skip 2 meas." } >>
\taktRest 3/4 2
}
>>
_______________________________________________
lilypond-devel mailing list
lilypond-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-devel