Take the 2-minute tour ×
Musical Practice & Performance Stack Exchange is a question and answer site for musicians, students, and enthusiasts. It's 100% free, no registration required.

I have LilyPond lead sheets for which I would like to be able to choose some display tweaks at compile time, primarily in order to tailor the sheet for the preferred transposition (e.g. for B-flat instruments) and clef of the musician to whom I'm handing it.

I believe style sheets and \include will give me a good way of handling this, but I would like a way to specify the name of the style sheet I'd like to select right from the lilypond command line invocation. What would be the best way to do this? Alternatively, is there another, better way to accomplish the goal?

share|improve this question
add comment

1 Answer 1

up vote 6 down vote accepted

Please read the magnificent documentation at lilypond.org specifically: http://lilypond.org/doc/v2.17/Documentation/usage/command_002dline-usage

music.ly:

#(use-modules (guile-user))
#(format #t "Using style sheet: ~a\n" style-sheet)
\include #style-sheet
\relative { c' d e }

style-default.ily: % style defs

Then run,

lilypond -e '(define-public style-sheet "style-default.ily")' music.ly
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.