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 12:04:29 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.0

Le 30/12/2022 à 00:19, Alasdair McAndrew a écrit :
Thank you SO very much! Such a simple thing ... (as is so often the case, certainly with my queries).  It now works perfectly.


Well, as a matter of fact, you're not the first one tripped up by this.

Makes me wonder if we should make it possible to do it like

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


Unlike # which starts a block in Scheme syntax, \ is LilyPond
syntax and stops at a brace or such. It also makes a copy, which
avoids problems like the one explained here:
https://lilypond.org/doc/v2.25/Documentation/notation/how-to-prevent-sharing-of-music-expressions
However, it doesn't work right now for local variables,
like function parameters, in #{ ... #}.



Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

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