lilypond-user
[Top][All Lists]
Advanced

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

Re: How do I define an Lilypond/Scheme alist as cons of two a lists?


From: David Nalesnik
Subject: Re: How do I define an Lilypond/Scheme alist as cons of two a lists?
Date: Sat, 13 Sep 2014 17:32:01 -0500

Hi Jay,

On Sat, Sep 13, 2014 at 4:53 PM, Jay Vara <address@hidden> wrote:
I have pitch names defined as a alist in Lilypond as below and it works
fine. \version "2.18.2"


pitchname = #`(
                (saa . , (ly:make-pitch -1 0 NATURAL))
                (raa . , (ly:make-pitch -1 1 FLAT))


                (sa . , (ly:make-pitch -1 0 NATURAL))
                (ri . , (ly:make-pitch -1 1 FLAT))
                (ga . , (ly:make-pitch -1 2 NATURAL))
                )

#(ly:parser-set-note-names parser pitchname)

musicA = \relative sa' { sa4 ri ga sa ri ga sa ri ga ri saa ga ri sa ga
raa  }

\score {\musicA}

I would like to define the variable pitchname as sum/join/append/cons of
two a lists, as below:


     firstpart = #`(
                    (saa . , (ly:make-pitch -1 0 NATURAL))
                    (raa . , (ly:make-pitch -1 1 FLAT))
                   )

    secondpart = #'(
                     (sa . , (ly:make-pitch -1 0 NATURAL))
                    (ri . , (ly:make-pitch -1 1 FLAT))
                    (ga . , (ly:make-pitch -1 2 NATURAL))
                    )

and combine the two, say:


 pitchname = #(append firstpart secondpart)

works, but you need a backquote (`) in your definition of secondpart.

--David

reply via email to

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