Hi,
## Intro
I'm trying to make a little project for myself to gather tunes I know.
It has a primitive UI, but you can see tunes, their descriptions and
rendered lilypond sheets.
[there will be sample files attached]
## Problem
That works and is great, but I'd like to be able to make compilation PDFs
of the tunes without
having two different source files, but that currently doesn't work.
The reason why compilations currently don't work is because the pieces
sometimes contain
multiple score parts, that both use a variable, but variables can't be
declared in a \book
part, so they can't be included neither directly nor via an \include.
## Solution?
I'd be more than happy to alter them programmatically and I took a look at
python-ly, but I've
yet to master its API, because I haven't found many examples yet.
I'm thinking I could cut all the variable definitions out and put them
before \book and also
fix any variable naming collisions, if there are any.
## Questions
1. Does anyone know where I could find some python-ly transformation code
examples before I've
either found them myself or figured out the API? Or offer me some code?
2. MAYBE there's a better way of combining the small files. I could combine
the PDF outputs,
but as this is a toy project, I'm happy to explore more unconventional
solutions.
Thank you!
\version "2.18"
\layout {
\accidentalStyle modern
\compressFullBarRests
}
\book {
\paper {
#(set-paper-size "a5")
print-all-headers = ##t
page-breaking = #ly:one-page-breaking
}
% \header {
% title = "My compilation"
% }
% these shall work
\include "small.ly"
\include "small.ly"
\include "small.ly"
% these shall not
% \include "small-variables.ly"
% \include "small-variables.ly"
% \include "small-variables.ly"
}
\score {
fes''1
c2.( d4)
dis1
\header {
subtitle = "Great track"
}
}
melody = \relative {
fes''1
f1
f1
c2.( d4)
dis1
\bar "|."
}
\score {
\melody
\header {
subtitle = "Great track"
}
}
\score {
\melody
\midi {}
}
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user