lilypond-user
[Top][All Lists]
Advanced

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

Re: Scheme: default values?


From: Marc Hohl
Subject: Re: Scheme: default values?
Date: Sun, 02 Feb 2014 08:51:38 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

Am 29.01.2014 06:41, schrieb Graham King:
To generate MIDI output, I use a piece of boilerplate lilypond code,
containing:
     \midi { \context { \Score tempoWholesPerMinute = #currentTempo }}
where it is expected that:
     currentTempo = #(ly:make-moment TACTUS RF)

I would like to generalise the boilerplate code so that it works with
suitable defaults even when these variables have not been defined.

Where do you want to define these variables? If you want to use them
via the command line, you can do it as follows (untested!):

#(define tactus-option
  (or (ly:get-option TACTUS) 50))
#(define rf-option
  (or (ly:get-option RF) 1))

currentTempo = #(ly:make-moment tactus-option rf-option)

anc call lilypond as follows:

lilypond -dTACTUS=60 yourfile.ly         # TACTUS=60  RF=1
lilypond -dRF=2 yourfile.ly              # TACTUS=50  RF=2
lilypond -dTACTUS=100 -dRF=3 yourfile.ly # TACTUS=100 RF=3
lilypond yourfile.ly                     # TACTUS=50  RF=4

I hope this helps a bit,

Marc




reply via email to

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