lilypond-learning: Warning key signatures and pitches

 
 Warning: key signatures and pitches
 ...................................
 
DONTPRINTYET  Music Glossary: See(music-glossary)accidental, *noteDONTPRINTYET DONTPRINTYET  Music Glossary: See(music-glossary)accidental, See
 (music-glossary)key signature, See(music-glossary)pitch, *noteDONTPRINTYET DONTPRINTYET DONTPRINTYET  Music Glossary: See(music-glossary)accidental, See
 (music-glossary)key signature, See(music-glossary)pitch, See
 (music-glossary)flat, See(music-glossary)natural, *noteDONTPRINTYET DONTPRINTYET DONTPRINTYET DONTPRINTYET  Music Glossary: See(music-glossary)accidental, See
 (music-glossary)key signature, See(music-glossary)pitch, See
 (music-glossary)flat, See(music-glossary)natural, See
 (music-glossary)sharp, See(music-glossary)transposition, *noteDONTPRINTYET DONTPRINTYET DONTPRINTYET DONTPRINTYET  Music Glossary: See(music-glossary)accidental, See
 (music-glossary)key signature, See(music-glossary)pitch, See
 (music-glossary)flat, See(music-glossary)natural, See
 (music-glossary)sharp, See(music-glossary)transposition, See
 (music-glossary)Pitch names.
 
    To determine whether to print an accidental, LilyPond examines the
 pitches and the key signature.  The key signature only affects the
 _printed_ accidentals, not the note’s pitch!  This is a feature that
 often causes confusion to newcomers, so let us explain it in more
 detail.
 
    LilyPond makes a clear distinction between musical content and
 layout.  The alteration (flat, natural sign or sharp) of a note is part
 of the pitch, and is therefore musical content.  Whether an accidental
 (a _printed_ flat, natural or sharp sign) is printed in front of the
 corresponding note is a question of layout.  Layout is something that
 follows rules, so accidentals are printed automatically according to
 those rules.  The pitches in your music are works of art, so they will
 not be added automatically, and you must enter what you want to hear.
 
    In this example:
 
      \key d \major
      cis4 d e fis
      [image src="" alt="[image of music]" text="image of music"]
 
 No note has a printed accidental, but you must still add ‘is’ and type
 ‘cis’ and ‘fis’ in the input file.
 
    The code ‘b’ does not mean “print a black dot just on the middle line
 of the staff.” Rather, it means “there is a note with pitch B-natural.”
 In the key of A-flat major, it _does_ get an accidental:
 
      \key aes \major
      aes4 c b c
      [image src="" alt="[image of music]" text="image of music"]
 
    If the above seems confusing, consider this: if you were playing a
 piano, which key would you hit?  If you would press a black key, then
 you _must_ add ‘-is’ or ‘-es’ to the note name!
 
    Adding all alterations explicitly might require a little more effort
 when typing, but the advantage is that transposing is easier, and
 accidentals can be printed according to different conventions.  For some
 examples of how accidentals can be printed according to different rules,
 see See(lilypond-notation)Automatic accidentals.
 
 
 See also
 ........
 
DONTPRINTYET     Notation Reference: See(lilypond-notation)Note names in other
 languages, See(lilypond-notation)Accidentals, *noteDONTPRINTYET DONTPRINTYET     Notation Reference: See(lilypond-notation)Note names in other
 languages, See(lilypond-notation)Accidentals, See
 (lilypond-notation)Automatic accidentals, *note(lilypond-notation)Key
DONTPRINTYET DONTPRINTYET     Notation Reference: See(lilypond-notation)Note names in other
 languages, See(lilypond-notation)Accidentals, See
 (lilypond-notation)Automatic accidentals, See(lilypond-notation)Key

 signature.