lilypond-learning: The direction property

 
 The ‘direction’ property
 ........................
 
 The following example shows in bar 1 the default behavior of stems, with
 those on high notes pointing down and those on low notes pointing up,
 followed by four notes with all stems forced down, four notes with all
 stems forced up, and finally four notes reverted back to the default
 behavior.
 
      a4 g c a |
      \override Stem.direction = #DOWN
      a4 g c a |
      \override Stem.direction = #UP
      a4 g c a |
      \revert Stem.direction
      a4 g c a |
      [image src="" alt="[image of music]" text="image of music"]
 
    Here we use the constants ‘DOWN’ and ‘UP’.  These have the values
 ‘-1’ and ‘+1’ respectively, and these numerical values may be used
 instead.  The value ‘0’ may also be used in some cases.  It is simply
 treated as meaning ‘UP’ for stems, but for some objects it means
 ‘center’.  There is a constant, ‘CENTER’ which has the value ‘0’.
 
    However, these explicit overrides are not usually used, as there are
 simpler equivalent predefined commands available.  Here is a table of
 the commonest.  The meaning of each is stated where it is not obvious.
 
 Down/Left      Up/Right       Revert             Effect
 ---------------------------------------------------------------------------
 ‘\arpeggioArrowDown’‘\arpeggioArrowUp’‘\arpeggioNormal’Arrow is at bottom, at
                                                  top, or no arrow
 ‘\dotsDown’    ‘\dotsUp’      ‘\dotsNeutral’     Direction of movement
                                                  to avoid staff lines
 ‘\dynamicDown’ ‘\dynamicUp’   ‘\dynamicNeutral’
 ‘\phrasingSlurDown’‘\phrasingSlurUp’‘\phrasingSlurNeutral’Note: distinct from
                                                  slur commands
 ‘\slurDown’    ‘\slurUp’      ‘\slurNeutral’
 ‘\stemDown’    ‘\stemUp’      ‘\stemNeutral’
 ‘\textSpannerDown’‘\textSpannerUp’‘\textSpannerNeutral’Text entered as spanner
                                                  is below/above staff
 ‘\tieDown’     ‘\tieUp’       ‘\tieNeutral’
 ‘\tupletDown’  ‘\tupletUp’    ‘\tupletNeutral’   Tuplets are below/above
                                                  notes
 
    The neutral/normal variants of these commands are implemented using
 ‘\revert’ and may *not* be preceded by ‘\once’.  If you wish to limit
 the effect of the other commands (which are implemented using
 ‘\override’) to a single timestep, you can precede them with ‘\once’
 like you would do with explicit overrides.