Hi,

I've been reproducing an old score, and wanted to be as faithful to the
original layout as possible, so I came up (with the help of several people
on here and in other internet places as well) with a custom dynamic mark,
which *almost* does what I want.

Vertically, the dynamic mark is centered between the two staves,
horizontally it comes after the end of the score, the text and its
formatting is how I want it. The only thing is that the staves lines
continue under, and I'd like for them to stop after the segno bar.

I attached a file to the mail with my code. If I remove the line 43
((ly:grob-set-property!
grob 'X-extent '(0 . 6))), I obtain what I describe as my goal, but when I
integrate with latex/lyluatex, I have a cropped version in which the
dynamic mark doesn't appear. The (ly:grob-set-property! grob 'X-extent '(0
. 6)) line ensures it's not cropped, but prolongs the staves lines.

If someone could tell me how to remove the extra staves lines, while
guaranteeing that the dynamic is not cropped when integrating in latex with
lyluatex, I'd be grateful :)
Claire
%%%%%%%%%%
%% VERSION
%%%%%%%%%%

\version "2.20.0"


%%%%%%%%%
%% GLOBAL
%%%%%%%%%

themeGlobal = {
	\time 4/4
	\key bes \major
}


%%%%%%%%
%% THEME
%%%%%%%%

themeUpper = \relative c'' {
	<a c>2 \breathe f4 bes |
}

themeLower = \relative c {
	<f f,> <f f,> \breathe r2
}


%%%%%%%%%%%
%% DYNAMICS
%%%%%%%%%%%

dalSegno = \markup \with-dimensions #'(0 . 0) #'(0 . 0) {
	\raise #-2.5 \center-column { "D. S." "al" "Fin" }
}

themeDynamics = {
	2 4 4 |
	\once \override Staff.BarLine.stencil =
		#(lambda (grob)
		(ly:grob-set-property! grob 'X-extent '(0 . 6))
		(ly:stencil-combine-at-edge
			(ly:bar-line::print grob)
			X RIGHT
			(grob-interpret-markup grob dalSegno)
			0))
	\bar "S-S"
}


%%%%%%%%%%%%%%%
%% PIANO SCORES
%%%%%%%%%%%%%%%

pianoUpper = {
	\clef "treble"
	\themeGlobal
	<<
		\new Voice {
			\themeUpper
		}
	>>
}

pianoLower = {
	\clef "bass"
	\themeGlobal
	<<
		\new Voice {
			\themeLower
		}
	>>
}


%%%%%%%%
%% SCORE
%%%%%%%%

\score {
	<<
		\new PianoStaff
		<<
			\new Staff = "upper" \pianoUpper
			\new Dynamics { \themeDynamics }
			\new Staff = "lower" \pianoLower
		>>
	>>
}

Reply via email to