lilypond-auto
[Top][All Lists]
Advanced

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

Re: [Lilypond-auto] Issue 1999 in lilypond: Nonsensical example in progr


From: lilypond
Subject: Re: [Lilypond-auto] Issue 1999 in lilypond: Nonsensical example in programming-interface.itely
Date: Wed, 25 Jul 2012 22:05:59 +0000


Comment #4 on issue 1999 by address@hidden: Nonsensical example in programming-interface.itely
http://code.google.com/p/lilypond/issues/detail?id=1999

I believe inline scheme is required to modify a variable, so I've
devised a music function whose action depends on an external variable.
Before I embark on major editing does this plan seem reasonable:

1. Add the following music function with fairly detailed explanation
as a third example in a new section 1.3.5.

2. Replace 2.8 entirely with a shorter section showing how a LP variable
can be changed with something like #(set! urtext #f), referring to the
new example at 1.3.5.

Here's the proposed music function:

ed =
#(define-music-function (parser location art)
                        (ly:event?)
   "Remove articulations marked as editorial if urtext is #t."
   (let ((m (make-music
              'ArticulationEvent
              'articulation-type
              (ly:music-property art 'articulation-type))))
     (if urtext
       (set! (ly:music-property art 'tweaks)
             (acons 'stencil #f
               (ly:music-property art 'tweaks))))
     art))

and some test code:

urtext = ##t
\relative c'' {
   c4 -\ed -^ ^"urtext"c -\ed ( c  c )
   c4 -\ed \f -\ed \< -\ed \( c c c \) -\ed \p
   c4 -\ed ^\markup "dolce" c c c
   \break
#(set! urtext #f)
   c4 -\ed -^ ^"edited" c -\ed ( c  c )
   c4 -\ed \f -\ed \< -\ed \( c c c \) -\ed \p
   c4 -\ed ^\markup \italic "dolce" c c c
}

Trevor





reply via email to

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