[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Minimum padding after barlines for notes with accidentals?
From: |
Markus Schneider |
Subject: |
Re: Minimum padding after barlines for notes with accidentals? |
Date: |
Thu, 14 Sep 2006 09:36:54 +0200 |
Hi all,
string numbers are too close to the preceding grob all the time in natural
spacing anyway (not only at a bar line), so
\layout {
\context {
\Voice
\override StringNumber #'minimum-X-extent = #'(-1.3 . 0.2)
}
}
will do the trick.
Also, I changed the function from the previous post to have
"only-at-barline" adjustments added more easily as they arise.
"Arpeggios-at-bar-beginning" are added this way.
Cheers,
Markus
%%% Begin snippet
%%% =============
\version "2.9.17"
%%% This could be renamed to "firstNoteSpacer"
%%% ------------------------------------------
accidentalSpacer = #(define-music-function (parser location timesig
duration ) (pair? ly:music?)
(make-music
'UnfoldedRepeatedMusic
'elements
'()
'repeat-count
(inexact->exact (round
(/ (* (ly:moment-main-numerator (ly:music-length duration))
(cdr timesig))
(* (ly:moment-main-denominator (ly:music-length duration))
(car timesig)))))
'element
(make-music
'SequentialMusic
'elements
(list #{
% Add/edit as needed
\override Staff.AccidentalPlacement #'left-padding = #0.8
\override Voice.Arpeggio #'minimum-X-extent = #'(-1
. 0.2)
#}
(make-music
'EventChord
'elements
(list (make-music
'SkipEvent
'duration
(ly:make-duration 0 0 (car timesig) (cdr
timesig) ))))))))
%%% Arpeggio example
musicII = {
\relative c'' {
\time 4/4
\repeat unfold 20 <g b d f>\arpeggio
}
}
\score { {
\new Staff <<
\context Voice = "D" \musicII
\context Voice = "D" \accidentalSpacer #'(4 . 4) \musicII
>>
}
\layout { indent = 0 ragged-right = ##t }
}
%%% ====================
%%% End Snippet