lilypond-devel
[Top][All Lists]
Advanced

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

updated files for (doc help) applyMusic -> music functions: add-text-scr


From: Michael Meixner
Subject: updated files for (doc help) applyMusic -> music functions: add-text-script.ly
Date: Wed, 7 Jun 2006 14:55:13 +0000 (UTC)
User-agent: Loom/3.14 (http://gmane.org/)

Hello!

Here are my attempts in updating for snippets for the Tricks & Tips section.
They compile correctly on my LP ver. 2.9.7

"add-text-script.ly"

% ****************************************************************
% Start cut-&-pastable-section 
% ****************************************************************

\paper {
  #(define dump-extents #t)
  
  indent = 0\mm
  line-width = 160\mm
}

\layout {
  
}



% ****************************************************************
% ly snippet:
% ****************************************************************
\sourcefilename "add-text-script.ly"


\header {
texidoc= "@cindex make-music Fingering
You can add various stuff to notes using @code{make-music}.
In this example, an extra fingering is attached to a note. 
"
} 

#(define (make-text-script x) 
   (make-music 'TextScriptEvent
               'direction DOWN
               'text (make-simple-markup x)))
     
#(define (add-text-script m x)
   (if (equal? (ly:music-property m 'name) 'EventChord)
       (set! (ly:music-property m 'elements)
             (cons (make-text-script x)
                  (ly:music-property m 'elements)))       
       (let ((es (ly:music-property m 'elements))
             (e (ly:music-property m 'element)))
         (map (lambda (y) (add-text-script y x)) es)
         (if (ly:music? e)
             (add-text-script e x))))
   m)

addScript =
#(define-music-function (parser location script music )
                                        ( string? ly:music? )
                (add-text-script music script))


\score { \addScript "6" { c'4-3 }
        
                        \layout{ ragged-right = ##t }
}





% ****************************************************************
% end ly snippet
% ****************************************************************






reply via email to

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