On 26/12/13 06:06, pabuhr wrote:
Merry Christmas, if anyone is out there today.

I'm trying to squeeze a piece onto a single page, and I'm fussing with stem
direction to control the height of the lines. I got the song to fit on a page,
except there are few note/beam clashes (see example below). Is there a way to
manually raise the beam to prevent the note clash. It's not going to look
pretty, but its more important to prevent page flipping.

\version "2.16.0"

melody = \relative c' {
  \time 3/4
        << { \stemUp e2 e4 } \\ { \stemDown s2 \shiftOn e,4 } \\ { \stemDown s4 g4 s4 
} \\ { \oneVoice \stemDown e'8 [ c ] \stemUp g [ c ] \stemDown e c } >> |
        << { \stemDown \shiftOn f,2. } \\ { \stemUp f'2 f4 } \\ { } \\ { \oneVoice 
\stemDown f8 [ d ] b [ d ] \stemDown f d } >> |
}

\score {
        <<
                \context Voice {
                        \mergeDifferentlyDottedOn
                        \mergeDifferentlyHeadedOn
                        \clef "treble_8"
                        \melody
                }
        >>
} % score

% Local Variables: %
% tab-width: 4 %
% compile-command: "lilypond --ps test1.ly" %
% End: %

You can explicitly set the position of the left and right ends of a beam with \override Beam #'positions. See below:

\version "2.16.0"


slope = #(define-music-function (parser location move) (pair?) #{

\once \override Beam #'positions = #move

#})


melody = \relative c' {

\time 3/4

<<

{ \stemUp e2 e4 } \\ { \stemDown s2 \shiftOn e,4 } \\ { \stemDown s4 g4 s4 }

\\

{ \oneVoice \stemDown e'8 [ c ] \stemUp g [ c ] \stemDown \slope #'(-0.5 . -1.5) e c }

>> |

<<

{ \stemDown \shiftOn f,2. }

\\

{ \stemUp f'2 f4 }

\\

{ }

\\

{ \oneVoice \stemDown \slope #'(0 . -1) f8 [ d ] b [ d ] \stemDown f d }

>> |

}


\score {

<<

\context Voice {

\mergeDifferentlyDottedOn

\mergeDifferentlyHeadedOn

\clef "treble_8"

\melody

}

>>

}


<<attachment: document.preview.png>>

_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to