lilypond-user
[Top][All Lists]
Advanced

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

transposing music via command line argument


From: Marc Hohl
Subject: transposing music via command line argument
Date: Tue, 27 Dec 2011 14:45:00 +0100
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111109 Thunderbird/3.1.16

Hello list,

in another thread, my problems with command line arguments were
solved (or workarounds provided), but now I am stuck with
another but similar problem:

I want to transpose some music and tell lilypond the 'to' pitch
in the command line:

lilypond -dpitch="e'" myfile.ly

where myfile.ly is

\version "2.15.24"

optionalTranspose = #(define-music-function (parser location music) (ly:music?)
  (let ((mypitch (ly:get-option 'pitch)))
       #{ \transpose c $mypitch  $music #}))

melody = { c'4 d' e'2 }

\score {
  \new Staff {
     \new Voice { \optionalTranspose \melody }
  }
}

Lilypond refuses to see mypitch as a pitch. I tried to convert it
with (ly:music-property mypitch 'pitch), but lilypond soesn't take
the command line argument as a music expression, too.

Is there any chance to convince lilypond to accept a pitch on
the command line?

Thanks in advance,

Marc



reply via email to

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