lilypond-user
[Top][All Lists]
Advanced

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

Re: Scoped variables


From: Peter Toye
Subject: Re: Scoped variables
Date: Mon, 4 Nov 2019 19:19:51 +0000

Hmm. Interesting.

But I still prefer properly scoped variables!

Peter



-------------------------
Monday, November 4, 2019, 6:46:05 PM, Timothy Lanfear wrote:

I was surprised to find that provided there is no explicit \book statement, variables can be redefined between bookparts and behave as desired.
\version "2.19.83"

I.Violin.1 = { \clef "treble" b'1 }
I.Violin.2 = { \clef "treble" g' }
I.Viola = { \clef "alto" d' }
I.Cello = { \clef "bass" g1 }

\bookpart {
  \score {
  <<
    \new Staff { \I.Violin.1 }
    \new Staff { \I.Violin.2 }
    \new Staff { \I.Viola }
    \new Staff { \I.Cello }
  >>
  }
}

I.Violin.1 = { \clef "treble" \key d\major cis''1 }
I.Violin.2 = { \clef "treble" \key d\major a' }
I.Viola = { \clef "alto" \key d\major e' }
I.Cello = { \clef "bass" \key d\major a1 }

\bookpart {
  \score {
  <<
    \new Staff { \I.Violin.1 }
    \new Staff { \I.Violin.2 }
    \new Staff { \I.Viola }
    \new Staff { \I.Cello }
  >>
  }
}

--
Timothy Lanfear, Bristol, UK.
reply via email to

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