lilypond-devel
[Top][All Lists]
Advanced

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

another feature for #{ ... #}


From: Nicolas Sceaux
Subject: another feature for #{ ... #}
Date: Sun, 26 Sep 2004 17:55:02 +0200
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hello,

I would like to add the following syntax to #{ ... #}:

  ;; in the following, myname is a symbol: 'myContextName 
  ;; it could also have been a string: "myContextName"
  #{ \context Voice = @myname { ... } #}

  ==>
  
  { \context Voice = myContextName { ... } }

This @ syntax could then be used for literal insertion of text into
the pattern.


That way, one is able to define, say:

lyricStaff = #(def-music-function (location voice-markup music lyrics) (markup? 
ly:music? ly:music?)
           "
Add a Voice with lyrics and an instrument name. Syntax: 
  \lyricStaff #(markup \"instrument name\")
    \notemode { c d e f }
    \lyricmode { do ré mi fa }
"
               (let ((name (gen-unique-context)))
                #{ << \context Voice = @name << 
                        \set Staff . instrument = $voice-markup 
                        $music >>
                      \lyricsto @name \new Lyrics $lyrics
                   >> #}))

May I?

nicolas





reply via email to

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