lilypond-user
[Top][All Lists]
Advanced

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

passing music symbols to define-music-function


From: Orm Finnendahl
Subject: passing music symbols to define-music-function
Date: Sun, 3 Dec 2006 09:58:15 +0100
User-agent: Mutt/1.5.11

Hi,

how is it possible to write music functions which use symbols as
parameters which get interpreted as pitch entities by the function?

I made three examples below to illustrate the problem. The third works
but is less than ideal in the lilypond source as the main purpose of
the definition is to get rid of the \parenthesize and the enclosing
chord brackets.

--
Orm

P.S.: Can anybody point me to reference on how to enlarge the
parenthesis or how to turn them into square brackets? I'm quite
comfortable writing scheme code and don't mind to delve into the
depths of lilypond as long as I get a hint on where to start and what
to change where.

------------------------------------------------------------------
The following two code segments *don't* work:

bracket = #(define-music-function (parser location note )
       (symbol? )
#{
            \set fontSize = #-4
            \once \override Stem #'transparent = ##t <\parenthesize $note>4
            \set fontSize = #1
#})

\relative c' {
     \bracket #'f
}

bracket = #(define-music-function (parser location note )
       (ly:music? )
#{
            \set fontSize = #-4
            \once \override Stem #'transparent = ##t <\parenthesize $note>4
            \set fontSize = #1
#})

\relative c' {
     \bracket f
}

------------------------------------------------------------------
This works:

bracket = #(define-music-function (parser location note )
       (ly:music? )
#{
            \set fontSize = #-4
            \once \override Stem #'transparent = ##t $note
            \set fontSize = #1
#})

\relative c' {
     \bracket <\parenthesize f>4
}





reply via email to

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