lilypond-user
[Top][All Lists]
Advanced

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

Re: A question about a scheme function with two input notes


From: Jean Abou Samra
Subject: Re: A question about a scheme function with two input notes
Date: Fri, 30 Dec 2022 00:16:59 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 30/12/2022 à 00:12, Alasdair McAndrew a écrit :
Hello,

I am typesetting some late Renaissance, early Baroque music for which a double stop (= chord with two notes) on a stringed instrument would be notated with the stem of the top note up and the stem of the lower note down.  So instead of using the standard notation

<a e>4

for a double stop, I am using

<< {a4} \\ {e4} >>

This is convenient as most of the music is with single notes, so I just bung in one of these when I need to.

And I thought I'd be clever by writing this into a little Scheme function:

dStop =
#(define-music-function
     (topnote bottomnote)
     (ly:music? ly:music?)
   #{
    << {#topnote} \\ {#bottomnote} >>


Try adding spaces here:

<< { #topnote } \\ { #bottomnote } >>

Scheme is very lax about what can happen in identifiers. It mostly separates elements by spaces. Therefore, if you write no space between '#topnote' and '}', Scheme sees a reference to a variable called 'topnote}', which is the meaning of the error message

Unbound variable: #{topnote\x7d;}#

Best,

Jean



Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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