lilypond-user
[Top][All Lists]
Advanced

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

Re: Help with scheme


From: William Rehwinkel
Subject: Re: Help with scheme
Date: Wed, 21 Aug 2024 10:06:12 -0400
User-agent: Mozilla Thunderbird

Dear Michael,

When I change

#(define *clefs-option* (ly:get-option 'clefs))

to

#(define *clefs-option* 'gamba)

and

(#t (define *use-gamba-clefs* #t))

to

(#t (set! *use-gamba-clefs* #t)) ; note "set!"


lilypond 2.25.18 compiles the code without any errors. But I don't know if this will make this example actually work.

Also, the use of ly:get-option is odd to me, I didn't know that the user could define custom options (if I do `lilypond -dclefs=normal clefs.ly` it says "warning: no such program option: clefs").

Could you show us a minimum example including an excerpt of music that renders using different clefs?

Thanks,
-William

On 8/21/24 09:19, Michael Gerdau wrote:
Dear lilyponders,

I've donwloaded some older lilypond sources (version 2.18.2) from cpdl.org and am trying to make them work with 2.25.18.

Most things are straight forward however there is some scheme code that allows to switch between different clefs.

Could someone with better scheme fu than I have tell me how I should adjust the code for 2.25.18?

The error I get is:
Starte lilypond 2.25.18 [scheme-error.ly]...
Processing `/home/mgd/lilypond-Noten/scheme-error.ly'
Parsing...
/home/mgd/lilypond-Noten/scheme-error.ly:10:2: error: Guile signaled an error for the expression beginning here
#
  (cond
Syntax error:
/home/mgd/lilypond-Noten/scheme-error.ly:10:0: body should end with an expression in form (let () (define *use-gamba-clefs* #t))
fatal error: failed files: "/home/mgd/lilypond-Noten/scheme-error.ly"
Wurde mit dem Return-Code 1 beendet.


Trying to make sense of the errormsg I verbatim replaced
   (#t (define *use-gamba-clefs* #t))
with
   (let () (define *use-gamba-clefs* #t))
but that doesn't work either (the error is different though).



snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip
\version "2.25.18"

#(define *clefs-option* (ly:get-option 'clefs))
% #(display "\nDEBUG: *clefs-options* = ") #(display (ly:get-option 'clefs)) #(display "\n")

#(define *use-recorder-clefs* (eq? *clefs-option* 'recorder))
#(define *use-gamba-clefs*    (eq? *clefs-option* 'gamba))
#(define *use-original-clefs* (eq? *clefs-option* 'original))

#(cond
   (*use-recorder-clefs*  (display "\nUsing recorder clefs.\n"))
   (*use-gamba-clefs*     (display "\nUsing gamba clefs.\n"))
   (*use-original-clefs*  (display "\nUsing original clefs.\n"))
   (#t (define *use-gamba-clefs* #t))
   )

insertClef = #(cond
                (*use-recorder-clefs*  #{ \clef treble #})
                (*use-gamba-clefs*     #{ \clef alto #})
                (*use-original-clefs*  #{ \clef mezzosoprano #})
                )
snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip -- snip

Kind regards,
Michael

--
William Rehwinkel (any pronouns)
Juilliard School '26 - Oberlin Conservatory '24
william@williamrehwinkel.net - https://williamrehwinkel.net
PGP Public Key: https://ftp.williamrehwinkel.net/pubkey.txt

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature


reply via email to

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