lilypond-devel
[Top][All Lists]
Advanced

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

scheme interface for all LilyPond syntactic constructs


From: Nicolas Sceaux
Subject: scheme interface for all LilyPond syntactic constructs
Date: Fri, 27 Feb 2004 20:37:17 +0100
User-agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3 (gnu/linux)

Hello,

I am currently writing a lib that aims at easily building music
expressions. I took the manual from the first page to the last one and
collected the syntactic constructs that imho ought to have a dedicated
scheme function or macro. It looks like this (drums.ly):

\score {
    <<
        \new DrumStaff \with {
            drumStyleTable = #timbales-style
            \override StaffSymbol #'line-count = #2
            \override BarLine #'bar-size = #2
        } <<
            \set Staff.instrument = "timbales"
            \timb
        >>
        \new DrumStaff <<
            \set Staff.instrument = "drums"
            \new DrumVoice {\stemUp \drh }
            \new DrumVoice {\stemDown \drl }
        >>
    >>
}

===>

\score {
    #(ly:export
      (mus:sim
       (mus:new-with DrumStaff
                     ((drumStyleTable timbales-style)
                      (override StaffSymbol line-count 2)
                      (override BarLine bar-size 2))
        (mus:sim
         (mus:set Staff instrument "timbales")
         timb))
       (mus:new DrumStaff 
                (mus:sim
                 (mus:set Staff instrument "drums")
                 (mus:new DrumVoice (mus:seq stemUp drh))
                 (mus:new DrumVoice (mus:seq stemDown drl))))))
}

The goal of course is to help users (hmm, it cannot be only me, there
must be few others!) creating scheme functions. Collateral damage:
internal function definitions may also be simpler.

Do you think that could actually be interesting? ie: should I go on
implementing and documenting this?

Note: There is some overlap with some functions from
music-functions.scm.

nicolas





reply via email to

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