lilypond-user
[Top][All Lists]
Advanced

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

Re: Specifying \language for a single book


From: Klaus Blum
Subject: Re: Specifying \language for a single book
Date: Mon, 20 Jan 2020 11:03:05 -0700 (MST)

Sandro Santilli-2 wrote
> I would ideally use an \override so to keep the existing
> definition of my leadSheet.

Hmmm, that sounds difficult. I assume your leadSheet contains chords and
staves like e.g.

% -----------------------------------------------
leadSheet = {
  <<
    \new ChordNames {
      % \italianChords   % maybe yes, maybe no...
      \chordmode {
        c1 g
      }
    }
    \new Staff {
      \relative c' {
        c4 d e f   g1
      }
    }
  >>
}
% -----------------------------------------------

AFAIK this definition is static and I know no override that could change
things at a later time. 
[To anybody reading this: Please correct me if I'm wrong.  ;-)  ]

But you could turn your "leadSheet" variable into a music function that
takes a boolean parameter telling if to use italian chords or not: 

% -------------------------------------------------------------
\version "2.19.83"

leadSheet = #(define-music-function (useItalianChords) (boolean?)
              #{
                <<
                  \new ChordNames {
                    #(if useItalianChords #{ \italianChords #})
                    c1 g
                  }
                  \new Staff \relative c' {
                    c4 d e f   g1
                  }
                >>
              #}
              )


\book {
  \bookOutputSuffix "G"
  \header { subtitle = "(G)" }
  \score {
    \transpose c b
    \leadSheet ##f
  }
}

\book {
  \bookOutputSuffix "F"
  \header { subtitle = "(F)" }
  \score {
    \transpose c a
    \leadSheet ##f
  }
}

\book {
  \bookOutputSuffix "F-ita"
  \header { subtitle = "(F)" }
  \score {
    \transpose c a
    \leadSheet ##t
  }
} 
% -------------------------------------------------------------

Another possibility would be to define separate variables for your chords
and notes:

% -----------------------------------------------
\version "2.19.83"

leadSheetChords = \chordmode {
  c1 g
}

leadSheetNotes = \relative c' {
  c4 d e f   g1
}

% In your \book parts, use this construction:

{
  <<
    \new ChordNames {
      \italianChords   % maybe yes, maybe no...
      \leadSheetChords
    }
    \new Staff {
      \leadSheetNotes
    }
  >>
}
% -----------------------------------------------

Cheers, 
Klaus




--
Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html



reply via email to

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