lilypond-user
[Top][All Lists]
Advanced

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

Re: synchronizing other parts w/cadenza


From: Thomas Morley
Subject: Re: synchronizing other parts w/cadenza
Date: Wed, 18 Jan 2012 02:01:11 +0100

Hi Paul,

2012/1/17 Paul Scott <address@hidden>:
> On 01/16/2012 09:41 PM, Paul Scott wrote:
>>
>> Hi,
>>
>> Ok, my thread about mmrest-of-length appears to be misguided.  I don't
>> think
>> NR 1.2.6 helped even though it looks like 1.2.6 Aligning to cadenzas is
>> intended
>> to answer this.
>>
>> I want to synchronize either a specific value of rest or note with a
>> cadenza.
>> I would say that mmrest-of-length is not any kind of answer.

I worked a little more in the direction you objected.

\version "2.15.24"

cadenzaRest =
#(define-music-function (parser location fermata? music) (boolean? ly:music?)
  "Make a full-bar rest with the same length as MUSIC
  setting measureLength to ensure the rest is properly centred.
  A fermata can be set."
  (let ((fermata (make-music 'MultiMeasureTextEvent
                             'tweaks (list
                                      ;; Set the 'text based on the 'direction
                                      (cons 'text (lambda (grob)
                                                    (if (eq?
(ly:grob-property grob 'direction) DOWN)
                                                        (markup
#:musicglyph "scripts.dfermata")
                                                        (markup
#:musicglyph "scripts.ufermata"))))
                                      (cons 'outside-staff-priority 40)
                                      (cons 'outside-staff-padding 0))))
        (lst (list
        #{
          \set Timing.measureLength = #(ly:music-length music)
          $(mmrest-of-length music)
          \unset Timing.measureLength
        #})))
 (make-sequential-music
  (if fermata?
  (cons fermata lst)
  lst))))

cadenzaNotes =
#(define-music-function (parser location music cad-music) (ly:music? ly:music?)
  (let* ((mus-len (ly:music-length  cad-music))
         (num (ly:moment-main-numerator mus-len))
         (denom (ly:moment-main-denominator mus-len))
        )
 (make-sequential-music
  (list
   #{
     \set Timing.measureLength = #(ly:music-length cad-music)
     \scaleDurations #(cons num denom) $music
     \unset Timing.measureLength
   #}))))


othernotes = \relative c'' { d1 c1 }
cnotes = \relative c'' {  c8[ d e f g]  c,8[ d e f g]}
snotes = { $(skip-of-length cnotes) }
mnotes = \cadenzaRest ##t \cnotes


\score {
 <<
   \new Staff { \othernotes \cnotes \othernotes }
   \new Staff { \othernotes \mnotes \othernotes }
   \new Staff { \othernotes \snotes \othernotes }
   \new Staff \relative c'' { d1 c1~ \cadenzaNotes { c2\fermata
g4\fermata c~ }  \cnotes  c1 d }
 >>
}

If it not fits to your needs, please specify why.

Cheers,
  Harm

Attachment: cadenza-02.png
Description: PNG image


reply via email to

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