transpositions within a global key setting.

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

transpositions within a global key setting.

N. Andrew Walsh
Hi List,

let us say I have a piece where I want to specify the key signature once for all instruments. I have something like the following:

\version = 2.19.82
global= {
 \key f \minor
 \time 4/8
  }
%% (and whatever other settings I want)

oDAMusic = \transpose a c {
  \relative c''' {
    \key as \minor
    {{MUSIC}}
  }
}
\score {
\new Staff = "Staff_oboeDA" <<
      \global \oDAMusic 
    >>
}

I've omitted other variables, instrument blocks, and settings. My question is what to do about this instrument, the oboe d'amore, which transposes. According to the NR, here:


I would need to format the block like this to print the correct key signature. When I do this, however, Lily throws an error about "Two simultaneous key-change events" and that one will be junked. Score output, however, looks fine, with the transposition and key-signature correct. 

As a general question, how should I be formatting this so that I don't get an error? 

Cheers,

A

Reply | Threaded
Open this post in threaded view
|

Re: transpositions within a global key setting.

Rick Kimpel-2
Andrew,
Try this:

\transposition a \transpose a c {
   \global
   \clef treble
   \relative c''' { %notes go here }
}

Regards,
Rick


From: lilypond-user <lilypond-user-bounces+rick.kimpel=[hidden email]> on behalf of N. Andrew Walsh <[hidden email]>
Sent: Monday, December 9, 2019 8:24 AM
To: lilypond-user <[hidden email]>
Subject: transpositions within a global key setting.
 
Hi List,

let us say I have a piece where I want to specify the key signature once for all instruments. I have something like the following:

\version = 2.19.82
global= {
 \key f \minor
 \time 4/8
  }
%% (and whatever other settings I want)

oDAMusic = \transpose a c {
  \relative c''' {
    \key as \minor
    {{MUSIC}}
  }
}
\score {
\new Staff = "Staff_oboeDA" <<
      \global \oDAMusic 
    >>
}

I've omitted other variables, instrument blocks, and settings. My question is what to do about this instrument, the oboe d'amore, which transposes. According to the NR, here:


I would need to format the block like this to print the correct key signature. When I do this, however, Lily throws an error about "Two simultaneous key-change events" and that one will be junked. Score output, however, looks fine, with the transposition and key-signature correct. 

As a general question, how should I be formatting this so that I don't get an error? 

Cheers,

A

Reply | Threaded
Open this post in threaded view
|

Re: transpositions within a global key setting.

N. Andrew Walsh
Hi Rick,

On Mon, Dec 9, 2019 at 4:54 PM Rick Kimpel <[hidden email]> wrote:
Andrew,
Try this:

What I ended up having to do was this, inside the \score block:

\new Staff = "Staff_oboeDA" <<
      \transposition a \transpose a c << \global \oDAMusic \keyandtempo >>
    >> 

(\keyandtempo is another variable that contains all the key and tempo changes, and consequently has to be within a multi-voice context with each instrument's variable).

But that worked! Thanks! That's exactly what I needed.

Cheers,

A
Reply | Threaded
Open this post in threaded view
|

Re: transpositions within a global key setting.

Urs Liska-3
In reply to this post by N. Andrew Walsh


Am 09.12.19 um 15:24 schrieb N. Andrew Walsh:
Hi List,

let us say I have a piece where I want to specify the key signature once for all instruments. I have something like the following:

\version = 2.19.82
global= {
 \key f \minor
 \time 4/8
  }
%% (and whatever other settings I want)

oDAMusic = \transpose a c {
  \relative c''' {
    \key as \minor
    {{MUSIC}}
  }
}


What this code is trying to convey (different from your intentions) that MUSIC is some music in as minor that is then transposed to f minor.

What you *need* to say is that the music is in f minor (because that is your key signature) but transposed *for display* to as minor. It should immediately strike you as odd when you seem to need to write \key as \minor when you are not actually having polytonality.

So the key signature in your music should be the f minor specified in the global variable (note BTW that it is not ideal practice naming a variable "global"), and you can simply include that *within* the music expression rather than in teh staff definition.

You define the music in the original key and then transpose it to the key you want it displayed in. If you are dealing with MIDI output (and even if not you should consider it) you can then use \transposition to re-transpose the MIDI output without affecting the engraved key and pitches (see http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches#instrument-transpositions (which is where you should have looked at)).

This is what you want to do:

\version  "2.19.82"
global= {
  \key f \minor
  \time 4/8
}

oDAMusic = 
\transpose f as 
\relative c' {
  \transposition a
  \global
  f g as
}

\score {
  \new Staff = "Staff_oboeDA" <<
    \oDAMusic 
  >>
}

HTH
Urs


\score {
\new Staff = "Staff_oboeDA" <<
      \global \oDAMusic 
    >>
}

I've omitted other variables, instrument blocks, and settings. My question is what to do about this instrument, the oboe d'amore, which transposes. According to the NR, here:


I would need to format the block like this to print the correct key signature. When I do this, however, Lily throws an error about "Two simultaneous key-change events" and that one will be junked. Score output, however, looks fine, with the transposition and key-signature correct. 

As a general question, how should I be formatting this so that I don't get an error? 

Cheers,

A

Reply | Threaded
Open this post in threaded view
|

Re: transpositions within a global key setting.

Wols Lists
On 10/12/19 06:41, Urs Liska wrote:

>
> Am 09.12.19 um 15:24 schrieb N. Andrew Walsh:
>> Hi List,
>>
>> let us say I have a piece where I want to specify the key signature
>> once for all instruments. I have something like the following:
>>
>> \version = 2.19.82
>> global= {
>>  \key f \minor
>>  \time 4/8
>>   }
>> %% (and whatever other settings I want)
>>
>> oDAMusic = \transpose a c {
>>   \relative c''' {
>>     \key as \minor
>>     {{MUSIC}}
>>   }
>> }
>
>
> What this code is trying to convey (different from your intentions) that
> MUSIC is some music in as minor that is then transposed to f minor.
>
> What you *need* to say is that the music is in f minor (because that is
> your key signature) but transposed *for display* to as minor. It should
> immediately strike you as odd when you seem to need to write \key as
> \minor when you are not actually having polytonality.
>
> So the key signature in your music should be the f minor specified in
> the global variable (note BTW that it is not ideal practice naming a
> variable "global"), and you can simply include that *within* the music
> expression rather than in teh staff definition.
>
> You define the music in the original key and then transpose it to the
> key you want it displayed in. If you are dealing with MIDI output (and
> even if not you should consider it) you can then use \transposition to
> re-transpose the MIDI output without affecting the engraved key and
> pitches (see
> http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches#instrument-transpositions
> (which is where you should have looked at)).
>
> This is what you want to do:
>
> \version  "2.19.82"
> global= {
>   \key f \minor
>   \time 4/8
> }
>
> oDAMusic =
> \transpose f as
> \relative c' {
>   \transposition a
>   \global
>   f g as
> }
>
> \score {
>   \new Staff = "Staff_oboeDA" <<
>     \oDAMusic
>   >>
> }
>
> HTH
> Urs
>
As a player in a concert band and a brass band, this is my main use of
lilypond. I don't use midi, and I've never got to grips with
transposition (because I don't use midi?)

So when I'm INPUTing music, I always do

voiceTrombone = \transpose c' c' { notes }
or
voiceTrombone = \transpose c' bf { notes }

This then gives me a music variable with all my notes IN CONCERT PITCH.

When outputting, I then do

\Staff {
   \Clef = bass
   \transpose c' c' {
      \key ...
      \voiceTrombone
      ...
   }
}

or

\Staff {
   \Clef = treble_8
   \transpose bf c' {
      \key ...
      \voiceTrombone
      ...
   }
}

That way, everything is always in concert until the last possible
moment, but also, when I'm looking at the music, I can tell whether it
was copied from a concert or a brass part, and the notes in the .ly file
match the notes on the piece of paper.

(And I *always* transpose, even from C to C, because it tells me I
haven't forgotten anything :-)

Cheers,
Wol

Reply | Threaded
Open this post in threaded view
|

Re: transpositions within a global key setting.

David Wright
In reply to this post by Urs Liska-3
On Tue 10 Dec 2019 at 07:41:07 (+0100), Urs Liska wrote:

> Am 09.12.19 um 15:24 schrieb N. Andrew Walsh:
> > let us say I have a piece where I want to specify the key
> > signature once for all instruments. I have something like the
> > following:
> >
> > \version = 2.19.82
> > global= {
> >  \key f \minor
> >  \time 4/8
> >   }
> > %% (and whatever other settings I want)
> >
> > oDAMusic = \transpose a c {
> >    \relative c''' {
> >      \key as \minor
> >      {{MUSIC}}
> >    }
> > }
>
> What this code is trying to convey (different from your intentions)
> that MUSIC is some music in as minor that is then transposed to f
> minor.
>
> What you *need* to say is that the music is in f minor (because that
> is your key signature) but transposed *for display* to as minor. It
> should immediately strike you as odd when you seem to need to write
> \key as \minor when you are not actually having polytonality.
>
> So the key signature in your music should be the f minor specified in
> the global variable (note BTW that it is not ideal practice naming a
> variable "global"),

But both the LM and NR use this convention frequently; the former
recommends it (§3.2.3).

> and you can simply include that *within* the music
> expression rather than in teh staff definition.

I don't see how that works for anything beyond the trivial, for example:

global = { % with original pagination
  \key f \major
  \time 2/2
  s1 * 3 \break
  s1
  \repeat volta 2 {
    s1 * 3 \break
    s1 * 3 \break
  } \alternative {
    {
      s1 * 2
    } {
      s1 \break
      s1
    } }
  s1 * 3 \break
  \pageBreak
  s1 * 5 \break
  s1 * 3 \break
  s1 * 3 \break
  s1 * 2
  \bar "||"
  \key c \major
  s1 \break
  s1 * 3 \break
  \pageBreak
  s1 * 3 \break
  s1 * 3 \break
  s1 * 3 \break
  s1 * 3 \break
  \bar "||"
  \key df \major
  s1 * 3 \break
  \pageBreak
  s1 * 3 \break
  s1 * 2
  \bar "||"
  \key f \major
  s1 \break
  s1 * 3 \break
  s1 * 3 \break
  s1
  \bar "||"
  s1 s2
  \bar "|."
}

#(set-global-staff-size 18)
\book {
  \bookOutputSuffix "2staves"
  \score {
    \transpose f f
    \new ChoirStaff <<
      \new Staff = stop \with { \consists Bar_number_engraver } <<
        \clef treble \global
        \new Voice { \accident \voiceOne \soprano }
        \addlyrics \with { alignAboveContext = stop } { \sopranofrag }
        \new Voice { \accident \voiceTwo \alto }
        \addlyrics { \altotext }
        \addlyrics { \altotextii }
      >>
      \new Staff = sbot <<
        \clef "bass^8" \global
        \new Voice { \accident \voiceOne \tenor }
        \addlyrics \with { alignAboveContext = sbot } { \tenorfrag }
        \new Voice { \accident \voiceTwo \bass }
        \addlyrics { \bassfrag }
      >>
    >>
    \layout {
      \context {
        \Score
        \remove Bar_number_engraver
      }
    }
  }
}

> You define the music in the original key and then transpose it to the
> key you want it displayed in. If you are dealing with MIDI output (and
> even if not you should consider it) you can then use \transposition to
> re-transpose the MIDI output without affecting the engraved key and
> pitches (see http://lilypond.org/doc/v2.19/Documentation/notation/displaying-pitches#instrument-transpositions
> (which is where you should have looked at)).
>
> This is what you want to do:
>
> \version  "2.19.82"
> global= {
>   \key f \minor
>   \time 4/8
> }
>
> oDAMusic =
> \transpose f as
> \relative c' {
>   \transposition a
>   \global
>   f g as
> }
>
> \score {
>   \new Staff = "Staff_oboeDA" <<
>     \oDAMusic
>   >>
> }
>
> > \score {
> > \new Staff = "Staff_oboeDA" <<
> >       \global \oDAMusic
> >     >>
> > }
> >
> > I've omitted other variables, instrument blocks, and settings. My
> > question is what to do about this instrument, the oboe d'amore,
> > which transposes. According to the NR, here:
> >
> > http://lilypond.org/doc/v2.19/Documentation/notation/changing-multiple-pitches#transpose
> >
> > I would need to format the block like this to print the correct
> > key signature. When I do this, however, Lily throws an error about
> > "Two simultaneous key-change events" and that one will be junked.
> > Score output, however, looks fine, with the transposition and
> > key-signature correct.
> >
> > As a general question, how should I be formatting this so that I
> > don't get an error?

Cheers,
David.