lilypond-user
[Top][All Lists]
Advanced

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

substitution with \movement


From: Stefan Thomas
Subject: substitution with \movement
Date: Wed, 11 Jun 2008 10:22:33 +0200

Dear Lilypond-users,
I want to make a substitution with the \movement-command ( look at: http://lsr.dsi.unimi.it/LSR/Item?id=444).
But unfortunately this doesn't work:
langsamer = {  \movement "subito meno mosso" "4" #69 }
How can I change it?
I had another strange experience with the movement-command:
When I exchange "\skip" with "s" in the below quoted example, it works fine, but in the the opposite case, I get a very strange error message.
Is it a bug?
Here the example:
%%%%%%%%%%% BEGIN %%%%%%%%
#(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
 #})

 global = { \time 2/4 \skip 2  \time 3/4 \movement "subito meno mosso" "4" #69  \skip 2. }
 pauke = { \clef bass c4 c c c c    }
 schlagzwo = { c'4 c' c' c' c' }
  \paper {
           ragged-bottom = ##f          
    ragged-last-bottom = ##f %wenn auf "t" gesetzt wird, dann wird das letzte System abgeschnitten!
    bottem-margin = 30 \mm
    horizontal-shift = 5 \mm
    between-system-space = #2
    between-system-padding = #2 %sorgt fuer ordentliche abstaende
    page-limit-inter-system-space = ##t
   
       }




\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}
   

         


 \context { \RemoveEmptyStaffContext }
 
        } %Ende des Layoutblocks!!!\new Score
{ << \set Score.markFormatter = #format-mark-box-letters

\override Score.VerticalAxisGroup #'remove-first = ##t
\new TimeSig  { \override Score.TimeSignature #'style = #'( ) \override Score.BarNumber #'break-visibility = ##(#t #t #t) %jede Taktzahl wird gezeigt, spaeter wieder loeschen!!
     \global      }
\new Staff  << \set Staff.instrumentName = "Pauken"
\set Staff.shortInstrumentName = "Pk." {  \pauke  } >>

\new Staff = "Schlagzeug 2" << \set Staff.instrumentName = "Perc. 2"
\set Staff.shortInstrumentName = "Perc. 2" { \schlagzwo  } >>


>>
}
\version "2.11.47"
%%%%%%%%%%%% END %%%%%%%%%%%%%


reply via email to

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