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