lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: shorten stem


From: Nick Payne
Subject: Re: shorten stem
Date: Thu, 26 Dec 2013 06:25:14 +1100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0

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
Description: PNG image


reply via email to

[Prev in Thread] Current Thread [Next in Thread]