lilypond-user
[Top][All Lists]

## Re: default stem direction

 From: Hans Forbrich Subject: Re: default stem direction Date: Tue, 13 May 2003 13:47:34 -0600

```(Apologies for the length - I'm in computer teacher mode <g>)

Remember that \stemUp, \stemDown and \stemBoth are just macros (in
1.6.6, they are defined in property-init.ly).

stemUp = \property Voice.Stem \set #'Direction = #1
stemBoth = \property Voice.Stem \revert #'Direction

You are likely looking for \stemBoth - but there's a catch

The secret here is in the way the reset works - you may get better hints
if you look at the \override and \set directives.  Basically consider
\set to be an open bracket, \revert to be a closed bracket, anything
between the brackets does the same thing.  #1 (in this case) means 'up'.

Now, the << {} \\ {} >> has an implied \stemUp for the direct {} and an
implied \stemDown for the second {}.  And I believe an implied \stemBoth
at the end of each {} as well.

You can add your own as well, but the \stemBoth might not appear to
reset if you have extra nested ones.  For example, consider

\stemUp (notes) \stemDown (notes) \stemUp (notes) \stemBoth

The \stemBoth matches to the last \stemUp, resets that and leaves the
result with \stemDown.

So a total reset to get "normal" behaviour would be

\stemUp (notes)
\stemDown (notes)
\stemUp (notes)
\stemBoth
\stemBoth
\stemBoth

(indent not necessary but very useful)
or

\stemUp (notes) \stemBoth
\stemDown (notes) \stemBoth
\stemUp (notes) \stemBoth

or (not recommended) you could define a macro such as

stemRevert = \property Voice.Stem \set #Direction = #0

Regardless - remember the implied \stemUp with the << {} \\ {} >>

HTH
/Hans

Hortense Landelier wrote:

> Hi -- I know I should be able to figure this out
> myself but I couldn't find the right documentation --
>
> How do you get the stems (and ties) to behave normally
> after using \stemUp or \stemDown?  I'm using
> <
>  {}
>  \\
>  {}
> >
> to get two voices on a staff and then I want to switch
> to chords, some of which are tied together, and I
> don't want the ties to all go up or down.  Any
> suggestions appreciated.  Thanks!
>
> __________________________________
> Do you Yahoo!?
> The New Yahoo! Search - Faster. Easier. Bingo.
> http://search.yahoo.com
>
> _______________________________________________
> Lilypond-user mailing list