[Top][All Lists]

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

Syntax-question about nested functions/procedures

From: Thomas Morley
Subject: Syntax-question about nested functions/procedures
Date: Wed, 1 Aug 2012 00:26:37 +0200


fiddling around with a new patch for issue 2646 I tried to integrate
default-parenthesize into another function.
The following returns an error when uncommenting \override
Score.ParenthesesItem #'font-size = #0 and applying it to an

\version "2.15.42"

parenthesizeII =
#(define-music-function (parser location mus) (ly:music?)

(define (proc arg)
;; from
    (if (memq 'event-chord (ly:music-property arg 'types))
       ;; arg is an EventChord -> set the parenthesize property
       ;; on all child notes and rests
        (lambda (ev)
          (if (or (memq 'note-event (ly:music-property ev 'types))
                  (memq 'rest-event (ly:music-property ev 'types)))
              (set! (ly:music-property ev 'parenthesize) #t)))
        (ly:music-property arg 'elements))
       ;; No chord, simply set property for this expression:
       (set! (ly:music-property arg 'parenthesize) #t))

        %\override Score.ParenthesesItem #'font-size = #0
        $(proc mus)

\relative c' {
        % works
        \parenthesizeII a'4-1

        % returns an error when uncommenting the
        % font-size-override above

What's wrong and how to do it better?


reply via email to

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