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



_______________________________________________
lilypond-devel mailing list
[EMAIL PROTECTED]
http://lists.gnu.org/mailman/listinfo/lilypond-devel

Reply via email to