lilypond-user
[Top][All Lists]
Advanced

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

Re: Text *not* attached to note ?


From: Nicolas Sceaux
Subject: Re: Text *not* attached to note ?
Date: Fri, 06 Feb 2004 20:15:59 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Fri,  6 Feb 2004 18:17:03 +0100, darius a dit : 

 > This is a typical case where Lilypond functions would come as 
 > a useful addition to variables. The text would be a parameter,
 > in something such as:

 > MySeq(x) = \notes {a^\x b c d a a}

 > Perhaps the right way of dealing with this would be to handle
 > them as symbolic macros rather than true functions. 
 > Besides, if we ever need recursion, we can always revert to 
 > Scheme :-)

 > Is this so bizarre that I'm the only Lilypond user who thinks
 > this might prove useful ?

There has been several times on this list requests of this kind of
TeX-like `macros', and the general answer was: use scheme. I think
that LilyPond's extensibility with scheme is under-used. The main
reason is that it's not very convenient, now, to build music
expressions in scheme. I remember few weeks ago Paul asking how to
parametrize an expression like: 
  \property Voice.TextScript \override #'padding = #x
                                   the parameter--^^^

With a little extra music-expression-maker library, a possible
solution was:

#(define*-public (text-pad pad #:optional once)
  (ly:export 
   (mus:context-override Voice TextScript padding pad #:once once)))

And then, you could use it in a \notes block:

\score { 
  \notes { 
    c'^"salut"                            % normal padding
    #(text-pad 3.0 #t) c'^"salut"         % 3.0 padding, once
    c'^"salut"                            % normal padding
    #(text-pad 4.0) c'^"salut" c'^"salut" % 4.0 padding, always
  }
}

You can do amazing things in scheme, which as built-in support for
functions, macros, etc, so there is no need of lilypond functions.
I plan to work on a library and documentation of 'lilypond in scheme'.
(I hope that might be useful).

nicolas





reply via email to

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