|
From: | tisimst |
Subject: | Re: Switching on/off instrument staff |
Date: | Wed, 8 Jul 2015 09:33:31 -0700 (MST) |
Wow, so many answers. I think Rob's solution will be the most close to what I need, however I fear Abraham already answered my question.
I'll explain my problem further: I'm working in a three volume anthology for a singers school, each volume will come in two versions, one for the professor and the other for the student. The professor's version must have all voice piano parts, while the student's should only have the voice part. Now, because this is a very large project that includes gregorian scores, a lot of text and some didactics, I've decide to assemble the book in LuaLaTeX using lyluatex package (a recent replacement for lilypond-book). So all lilypond files (about 80 right now, but they will be something like 200 in the end) are configured from a single style sheet named formato.ly, wich contains all snippets, formats, etc. So what I am looking for, is a snippet that can disable all piano parts across the project from a single line in such formato.ly. To replace the \score block in all of the files could be both painful and dangerous, but I prefer to do it right now than later, when there will be much more of them; and since all files are generated from a template, I can just replace it with any text editor.
Anyway, if somebody has an idea of how to make this, I'll really apreciate.
Thanks to all for your answers, best regards.
Víctor
El 08/07/15 a las 07:00, Robert Schmaus escribió:
Hi Chris,
The tag method is a fantastic tool in many cases, so it's great to be aware of it. Just in this particular case it's maybe not the easiest way to go.
Yeah, that's how I mostly use variables as well - placing just the music in variables and then, in the score block, build up a
\new StaffGroup <<\new Staff \new Voice \someMusic\new Staff <<\new Voice { \voiceOne \moreMusic }\new Voice { \voiceTwo \yetMoreMusic }>>>>
I find this a very clear structure ... and it allows me to have a "complete" template where you just comment out all \Staffs you don't need in a particular case.
Cheers, Rob
______
Truth does not change according to our ability to stomach it.-- Flannery O'ConnorHi Rob,
Wow, thanks, that's a much neater way. I think I should probably look at refactoring my band template.
I agree, my method is a bit complicated -- but it's bothering me a bit, because I think there was a reason I did it like this in the first place! Could well be an insufficient understanding at the time, of how variables work :-)
I do already use variables as:
violinMusic = { a b c d }
violinVoice = \new Voice {% voice setup stuff %
\violinMusic}
Chris
On 8 July 2015 at 09:58, Robert Schmaus <[hidden email]> wrote:
In addition to the suggested way with tags (which surely works, but
which I find overly complicated), a simpler way would be to simply place
the Staffs in variables and comment out the ones you don't want to have
in the next engraving. Like this:
violinStaff = \new Staff \with { instrumentName = "Violin" }{
\relative c'' { c4 d e f }
}
celloStaff = \new Staff \with { instrumentName = "Cello" }{
\relative c { c4 d e f }
}
\score{
<<
\violinStaff
\celloStaff
>>
}
IMO there's no need for a complicated tag structure, just go for a
simple approach. You will want to use a variable structure for any
non-trivial score anyway ...
Best, Rob
Am 07/07/15 um 17:42 schrieb Víctor:
> [hidden email]> Hello Lilyponders:
>
> Is there a way to place a switch in some instrument part so it is not
> rendered when such switch is off? Something like:
>
> \score{
> <<
> \new Staff \with { instrumentName = "Violin" }{
> \relative c'' { c4 d e f }
> }
> \new Staff \with { instrumentName = "Cello" }{
> \relative c { c4 d e f }
> }
> >>
> }
>
> \layout{
> \disableCello
> }
>
> Thanks,
> Víctor.
>
> _______________________________________________
> lilypond-user mailing list
> https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________ lilypond-user mailing list [hidden email] https://lists.gnu.org/mailman/listinfo/lilypond-user
_______________________________________________
lilypond-user mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/lilypond-user
If you reply to this email, your message will be added to the discussion below:http://lilypond.1069038.n5.nabble.com/Switching-on-off-instrument-staff-tp178484p178514.htmlTo start a new topic under User, email [hidden email]
To unsubscribe from Lilypond, click here.
NAML
[Prev in Thread] | Current Thread | [Next in Thread] |