lilypond-user
[Top][All Lists]
Advanced

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

Re: Header inside the score context


From: Valentin Petzel
Subject: Re: Header inside the score context
Date: Wed, 24 Nov 2021 17:00:14 +0100

Hello Paolo,

I don’t really understand what you want to do. But if you only want render 
parts of your project I advise against commenting out and commenting in stuff. 
Instead (since you have a new section there anyway) put the different sections 
into different scores (you can tweak the second score so that it does not in 
fact look like it’s a new score) in different files. Then you could have a 
file header.ly which contains the header, a file secI.ly which contains the 
first section, secII.ly which contains the second section and so on. And then 
you could simply do

\include "header.ly"
\include "secI.ly"
\include "secII.ly"

and so on. If you want to render one section you just need to render the 
particular file.

If you don’t want separate scores you could do use files which define the 
different parts in variables and stitch them together in the score.

Like if you have a duetto with flauto dolce and bass tuba for example 
(marvellous combination!) you could have in
secI.ly:
FluteSecI = { music }
TubaSecI = { music }

And similar in secI.ly. Then in the score you can stitch them together like
Flute = { \FluteSecI \pageBreak \FluteSecI }
And similar.

Then to get an output in your separate file you can create a separate score, 
only containing the section (which is something you could probably quickly do 
using templates.

You can then assign this score to a variable like thisscore=\score{...} and 
then do something like
#(if (not (defined? 'included)) (add-score thisscore))

Then you can do #(define included 0) (or whatever value) before you include 
these files, and thus these scores will not be output if you compile the full 
score, but if you compile the files themselves they are.

Cheers,
Valentin


Am Mittwoch, 24. November 2021, 13:01:11 CET schrieb Paolo Prete:
> Hello,
> 
> Given a header like this:
> 
> %%%%%%%%
> \markuplist {
> 
> \fill-line {
>   \override #'(font-name . "Liberation Sans")
>   \override #'(font-size . 6)
>   "Author"
> }
> 
> \vspace #4
> 
> \fill-line {
>   \override #'(font-name . "Liberation Sans")
>   \override #'(font-size . 15)
>   "Title"
> }
> 
> \vspace #2
> 
> \fill-line {
>   \override #'(font-name . "Liberation Sans")
>   \override #'(font-size . 10)
>   "Subtitle"
> }
> 
> \vspace #6
> 
> }
> 
> {
> 
> %section 1
> c'1 c' c' \break c' c'
> 
> \pageBreak
> 
> %section 2
> e'1 e' f' \break f' f'
> 
> }
> 
> %%%%%
> 
> ... I would like to put it inside the score context. Is it possible ?
> In this way, given that the above header is only bound to the first page of
> the score, if I want to render only page 2 I would not need two block
> comments  (page 1 and header), but I would use only one block comment.
> 
> (Maybe by using the following hacky way to have multiple marks on the same
> bar:
> https://lilypond.org/doc/v2.23/Documentation/snippets/expressive-marks
> (Creating simultaneous rehearsal marks) ?)
> 
> Thanks!
> 
> P

Attachment: signature.asc
Description: This is a digitally signed message part.


reply via email to

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