lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme question: symbol to music


From: Johan Vromans
Subject: Re: Scheme question: symbol to music
Date: 12 Nov 2008 17:28:37 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4

Johan Vromans <address@hidden> writes:

> Stay tuned, it'll get even better...

If it would only work...

What I'm trying to achieve is to have input lines processed
selectively based on whether certain symbols are defined.

For example, I have a file "highstaff.ly":

      \new Staff = High <<
         \new Voice = HighVoice {
           \set Staff.instrumentName = \highName
           \set Staff.midiInstrument = "acoustic grand"
           \global
           \highMusic
         }
         \new Lyrics \lyricsto HighVoice \highWords
      >>

This file is included in the main score file.

Since this is a generic fragment, I'd like to use it in situations
where this voice does not have words. Using some not-yet-existing
functions:

      \new Staff = High <<
         \new Voice = HighVoice {
           \set Staff.instrumentName = \highName
           \set Staff.midiInstrument = "acoustic grand"
           \global
           \highMusic
         }
         \ifDefined #'highWords
           \new Lyrics \lyricsto HighVoice \highWords
         \endIf
      >>

A scheme alternative would be acceptable, e.g.,

  #(if (defined? 'highWords)
       (ly:parser-parse-string ???
        "\\new Lyrics \\lyricsto HighVoice \\highWords"))

Suggestions on how to do this are appreciated.

-- Johan




reply via email to

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