On 27 November 2011 11:21, James <pkx1...@gmail.com> wrote:
> It's because of the \relative I think; the Notation Reference does actually
> talk about this - I don't think of 'transposing'  without thinking about the
> changing of the key signature, which I don't want to do. Hence I didn't even
> think to use \transpose!
> So it seems I have to define the transposition within the 'Music' expression
> itself:
> Music = {
>   \key d \major
>   \transpose b c { a b c d | a b c d | a b c d }
> }
> Which keeps the key signature and does indeed shift the notes, great!
> But then I cannot (seem to) use \relative and this becomes absolute octave
> entry exercise.
> Unless I have misread the NR?

You could use a "global" variable containing the key changes.

%%%%

\version "2.14.1"

Music = {
  % \key d \major
  a b c d | a b c d |
  % \key d \minor
  a bes c d | a bes c d |
}
global = {
  \key d \major
  s1*2 |
  \key d \minor
  s1*2 |
}

\score {
  <<
    \new Staff {
      % without altering the key signature
      <<
        \global
        \transpose b c' \relative c ' { \Music }
      >>
    }
    \new Staff {
      % altering the key signature
      \transpose b c' {
        <<
          \global
          \relative c ' { \Music }
        >>
      }
    }
  >>
}

%%%%

Personally, I would use the \relative within the "Music".
Music = \relative c' {
  % etc.
}
and then, in  \score , simply  \Music  (without the \relative c' ).

Cheers,
Xavier

-- 
Xavier Scheuer <x.sche...@gmail.com>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to