On Fri, Apr 10, 2015 at 1:48 PM, Klaus Blum <[email protected]> wrote:
> Hi Eljakim,
>
> all I can offer you is a function to simplify things a little bit.
> However, it is necessary to pass two parameters:
> - a destination pitch for transposition and key signature
> - a markup for use in the title
>
> % --------------------------------------------------------------------
>
> \version "2.18.2"
>
> exercise =
> #(define-music-function (parser location p str) (ly:pitch? markup?)
> #{
> \new GregorianTranscriptionStaff
> \clef treble
> \key $p \major
> \omit Staff.TimeSignature
> \transpose c $p {
> \relative c'
> {
> \mark \markup {"Exercise in" $str "major" }
> c8[ d] e [f]
> }
> }
> \pageBreak
>
> #})
>
>
> \score {\exercise c "C" }
> \score {\exercise d "D" }
> \score {\exercise e "E" }
>
> % --------------------------------------------------------------------
>
> It would be cool to have a function that turns a pitch into a markup, but I
> had no luck so far.
>
You could adapt your function like this:
% --------------------------------------------------------------------
#(use-modules (scm display-lily))
\version "2.18.2"
exercise =
#(define-music-function (parser location p) (ly:pitch?)
(let ((str (string-capitalize
(symbol->string (note-name->lily-string p parser)))))
#{
\new GregorianTranscriptionStaff
\clef treble
\key $p \major
\omit Staff.TimeSignature
\transpose c $p {
\relative c'
{
\mark \markup {"Exercise in" $str "major" }
c8[ d] e [f] s2
}
}
\pageBreak
#}))
\score {\exercise c }
\score {\exercise d }
\score {\exercise e }
% --------------------------------------------------------------------
--David
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user