lilypond-user
[Top][All Lists]
Advanced

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

Re: ly:pitch and string


From: Simon Albrecht
Subject: Re: ly:pitch and string
Date: Sat, 11 Oct 2014 20:11:43 +0200
User-agent: Mozilla/5.0 (Windows NT 6.1; rv:31.0) Gecko/20100101 Thunderbird/31.1.2

Hello David,

thanks, that’s exactly the kind of brief and elegant solution I was hoping for.

Yours,
Simon

Am 11.10.2014 um 16:52 schrieb David Kastrup:
Simon Albrecht <address@hidden> writes:

Hello,

consider the following setup:
%%%%%%%%%%%%%%
\version "2.19.12"

newTonic = d

newTonicString = "d"

\bookOutputSuffix #(string-append "in-" newTonicString)

\score { \transpose c \newTonic { c' } }

%%%%%%%%%%%%%%

For easy handling of different transpositions the ‘destination pitch’
is stored in a variable. It is of type ly:pitch?.
At the same time, I want to flag the output file with the key to which
the music has been transposed, and for this I need the destination
pitch notename as a string.
I’d like to avoid having to synchronise newTonic and newTonicString
manually, but I’ve been unable to find a convenient way to convert one
into the other. Can anybody help?
(use-modules (scm display-lily))
newTonicString = #(value->lily-string newTonic parser)

Note that the conversion requires the availability of "parser" since it
depends on the current value of the note name language.





reply via email to

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