lilypond-user
[Top][All Lists]
Advanced

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

Re: textlength in timesig


From: Stefan Thomas
Subject: Re: textlength in timesig
Date: Mon, 15 Sep 2008 18:14:32 +0200

Dear Kieren,
the problem here is of a different kind. In this multi-measure Rest the "TimeTextAn"-command doens't help, unfortunately.
The example is very long, sorry!
#(define ((make-format-movement-markup-function text) duration count context)
 (markup #:huge #:bold text #:hspace 1
         "("
         #:general-align Y DOWN #:smaller
            #:note-by-number (ly:duration-log duration)
                             (ly:duration-dot-count duration)
                             1
         "="
         (number->string count)
         ")"))


#(define (string->duration duration-string)
 "Parse the `duration-string', e.g. ''4..'' or ''breve.'', and return a duration object."
 (let* ((length (string-length duration-string))
        (dot-index (or (string-index duration-string #\.) length))
        (len (substring duration-string 0 dot-index))
        (dots (- length dot-index)))
  (ly:make-duration (cond ((string=? len "breve") -1)
                          ((string=? len "longa") -2)
                          ((string=? len "maxima") -3)
                          (else (log2 (string->number len))))
                    dots 1 1)))


movement =
#(define-music-function (parser location text duration count music)

                       (string? string? integer? ly:music?)
 #{
   \set Score.metronomeMarkFormatter = #(make-format-movement-markup-function $text)
   \set Score.tempoWholesPerMinute = #$(ly:moment-mul (ly:make-moment count 1)
                                         (ly:duration-length
                                           (string->duration duration)))
   \set Score.tempoUnitDuration = #$(string->duration duration)
   \set Score.tempoUnitCount = #$count
   $music
   \set Score.metronomeMarkFormatter = #format-metronome-markup
 #})


TimeTextAn = {
  \override TimeSig.TextScript  #'extra-spacing-width = #'(0 . 0)
  \override TimeSig.TextScript  #'infinite-spacing-height = ##t
}

TimeTextAus = {
  \override TimeSig.TextScript  #'extra-spacing-width = #'(+inf.0 . -inf.0)
  \override TimeSig.TextScript  #'infinite-spacing-height = ##f
}

 
textweg = #(define-music-function (parser location padding) (number?)
       #{
          \override TextScript #'staff-padding = #$padding
       #})
\version "2.11.49"
\layout{

  \context {                     %hier wird ein neuer "Kontext" mit Namen "timesig" geschaffen   
    \type "Engraver_group"
  
    \consists "Text_spanner_engraver"
    \consists "Text_engraver"
    \consists "Dynamic_engraver"
    \consists "Axis_group_engraver"
    \name "TimeSig"
   
   
    
  }
  \context {
\Score \accepts TimeSig} }

re = { \change Staff = rechts }
li = { \change Staff = links }

%%%%%%%%%%%%%%%%%%%%       the music %%%%%%%%%%%%%%
tempotakt = { \TimeTextAn
    \textweg #-113
    \mark \default
    \movement "meno mosso" "4" #92
s 1*6
    s 1*4 \noBreak %tempotakt15-18
 s 8*7 s 8 %tempotakt 19, ende Klaviersolo
\mark \default
%jetzt kommt ein Abschnitt mit viel los. Takt 20 ff
\time 2/4 s16-\markup { \column { \upright "subito piu mosso"   \line { "(" \note # "4" #0.75 "= 120)" } \upright "molto rit." } } %tempotakt 20, tempoangabe, hoffentlich schauts gescheit aus
s8. s8. s16  |\noBreak %tempotakt 20
\tempo 4 = 60 s2 | \break %tempotakt 21
\tempo 4 = 120 s8-\markup {"molto rit."} s4 s16 s  | %tempotakt 22
\tempo 4 = 60 \time 3/4 s2. | %tempotakt 23
                            }
marimbarechtsnoten = {
    R 1*6
    R 1*5
\skip 4. r8  %marimbarechts 20
R2 | %marimbarechts 21
s4 s8. r16 | %marimbarechts 22
R2. | %marimbarechts 23

}

marimbalinksnoten =  \relative c { \clef bass
   
R 1*6
    R 1*5
\override Beam #'grow-direction = #LEFT \featherDurations #(ly:make-moment 2 1 ) {bes16\f\>-> [ e16 a16 \re d fis gis\p]} s8  %marimbalinks 20
\li R2 %marimbalinks 21
\override Beam #'grow-direction = #LEFT \featherDurations #(ly:make-moment 2 1 ) {\li bes,,16->\f\> [ e16 a16 \re d ges as bes]\p } s16 %marimbalinks 22
\li R2. | %marimbalinks 23

}
\new Score
{ \override Score.Hairpin #'minimum-length = #8
\set Score.skipBars = ##t %damit werden die Mehrtaktpausen korrekt angezeigt
<<
    \set Score.markFormatter = #format-mark-box-letters
    \override Score.VerticalAxisGroup #'remove-first = ##t
    \new TimeSig  { \override Score.TimeSignature #'style = #'( )
   
        \override TimeSig.VerticalAxisGroup #'minimum-Y-extent = #'(-0 . -1) 
    \tempotakt   }
          
    \new PianoStaff = "Marimba"
        <<
        \set PianoStaff.instrumentName = "Marimba"
        \set PianoStaff.shortInstrumentName = "Mar."   
        \new Staff= "rechts" { 
        %\override Staff.VerticalAxisGroup #'minimum-Y-extent = #'(1 . 3) %bedeutet:
        %nach oben sehr großer Abstand, nach unten groß, nicht sehr groß
        \marimbarechtsnoten }
         \new Staff = "links" \with {
          \override VerticalAxisGroup #'keep-fixed-while-stretching = ##t }
        {   \marimbalinksnoten   }
        >>
>>
}




2008/9/15 Kieren MacMillan <address@hidden>
Hi Stefan,


How could I change the alignment of the tempo-text (e.g. "Subito Piu Mosso" ) to the left side of the multimeasure bar?

I don't know how you've defined/coded it, so I can't answer that question — please include a minimal code example.

Cheers,
Kieren.


reply via email to

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