lilypond-user
[Top][All Lists]
Advanced

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

Re: scheme question


From: Matthieu Jacquot
Subject: Re: scheme question
Date: Thu, 24 Jul 2008 14:06:57 -0700 (PDT)

OK, I found a very good code on the french mailing list, still not perfect
but it's a big step forward! 
===========================================================================
\version "2.11.*"
str = #(define-music-function (parser location str music) (string?
ly:music?)
            (let ((spanned-music
                    (let ((first-element #f) (last-element #f) (first-found?
#f))
                      (music-map (lambda (m)
                                   (if (equal? (ly:music-property m 'name)
'EventChord)
                                       (begin (if (not first-found?)
                                             (begin  (set! first-found? #t)
                                               (set! first-element m)))
                                         (set! last-element m)))
                                   m)
                                 music)
                      (if first-found?
                          (begin
                            (set! (ly:music-property first-element
'elements)
                                  (cons (make-music 'TextSpanEvent
'span-direction -1)
                                        (ly:music-property first-element
'elements)))
                            (set! (ly:music-property last-element 'elements)
                                 (cons (make-music 'TextSpanEvent
'span-direction 1)
                                       (ly:music-property last-element
'elements)))))
                      music)))
         (make-music 'SequentialMusic
            'origin location
             'elements (list #{
\once \override TextSpanner #'font-size = #-3
\once \override TextSpanner #'staff-padding = #3
\once \override TextSpanner #'style = #'dotted-line
\once \override Staff.TextSpanner #'dash-period = #'0.4 
\once \override TextSpanner #'to-barline = ##f
\once \override TextSpanner #'bound-details = #'((left (Y . 0) (padding .
0.25) (attach-dir . -2)) (right (Y . 0) (padding . 0.25) (attach-dir . 2)))
\once  \override TextSpanner #'bound-details #'left #'text = \markup {
\circle \bold $str }
\once  \override TextSpanner #'bound-details #'right #'text = \markup {
\draw-line #'( 0 . -.5) } 
                #}
                          spanned-music))
                            ))
{ \str "5" {c'8 d' e' } f' <g'\4>\str "G" { a' b'}}
========================
-- 
View this message in context: 
http://www.nabble.com/scheme-question-tp18628816p18640520.html
Sent from the Gnu - Lilypond - User mailing list archive at Nabble.com.





reply via email to

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