[Top][All Lists]

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

Re: Switching on/off instrument staff

From: tisimst
Subject: Re: Switching on/off instrument staff
Date: Wed, 8 Jul 2015 10:43:30 -0700 (MST)

On Wed, Jul 8, 2015 at 11:26 AM, Víctor [via Lilypond] <[hidden email]> wrote:

You just gave me a wonderful solution, I'll explain myself:

My current file layout is like this:

\version "2.19.15"

\include ""    % file with lots of snippets (really)
\include ""  % typographies

\layout {
    % some overrides here

% some format snippets here:
formatoPerc = { \stemDown }

\include ""

control { } % this normaly stays empty, but can be used to add code to the voice without "polluting" it

voz = { a4 b c }
verso = \lyricmode { la la la }

pianoDer = { a4 b c }
pianoIzq = {a4 b c }

dinamicas = { s4\pp s4 s4\f } % some dynamics here

\score {
    \new Staff \with { instrumentName = \vozSolo } << % this variable is defined in
      \new Voice \voz
      \addlyrics \verso
      \new Voice \control
    \new PianoStaff \with { instrumentName = \pianoIns } <<
      \new Staff = "MD" <<
        \new Voice \pianoDer
        \new Dynamics \dinamicas
      \new Staff = "MI" {
        \clef bass
But now I've realized that \score should be declared in a separate file, something like, and there I can easely comment out the piano staff for all my files at once, avoiding both pain and human mistakes.

Thanks again to all of you for your support. Best regards,

Glad I could offer some help! Yes, if the \score block is the same for each song, then putting it in its own file and \include-ing it after the variable definitions is a handy way to solve this problem, for reasons you've already discovered. 

Also, I don't know if it makes a difference to you (it appears the output doesn't change), but I'd move your Dynamic section more explicitly in-between the two piano staves. I think it just makes the code a little cleaner. Like this:

\new PianoStaff <<
  \new Staff ...
  \new Dynamics ...
  \new Staff ...

Oh, and you don't need to explicitly create a \new Voice anymore in the upper piano Staff if you do that. Just a small suggestion.

- Abraham

View this message in context: Re: Switching on/off instrument staff
Sent from the User mailing list archive at

reply via email to

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