Il 24/11/2012 03:34, Keith OHara ha scritto:
You might not have seen that Nick posted a much nicer formatting for
barre indications.
<http://lists.gnu.org/archive/html/lilypond-user/2012-11/msg00570.html>
It avoids taking apart LilyPond's internal data structures, which makes
it better for mutopiaproject.
You can adjust Nick's function to use it as \barre 3 { %{ music %} } and
have it set minimumFret=3 so you don't need so many string number
entries. Scheme can convert to Roman numerals.
barre = #(define-music-function (parser location
strg music) (number? ly:music?)
#{
\set TabStaff.minimumFret = $strg
\set TabStaff.restrainOpenStrings = ##t
\once\override TextSpanner #'(bound-details left text)
= #(format #f "B ~@r" strg)
%{ ... Nick's other style settings ...%}
<>\startTextSpan
$music
<>\stopTextSpan
\unset TabStaff.minimumFret
\unset TabStaff.restrainOpenStrings
#})
I've just realized that it would be better not to specify the context
and let LilyPond use the Voice context, otherwise semi-barré are not
possible in polyphonic music.
See this example:
\version "2.17.9"
barreOld =
#(define-music-function (parser location strg music)(number? ly:music?)
#{
\set Staff.minimumFret = $strg
\set Staff.restrainOpenStrings = ##t
\once \override TextSpanner.bound-details.left.text = #(format #f
"B ~@r" strg)
\once \override TextSpanner.font-shape = #'upright
\once \override TextSpanner.bound-details.left.stencil-align-dir-y
= #CENTER
\once \override TextSpanner.style = #'line
\once \override TextSpanner.bound-details.right.text = \markup
\draw-line #'(0 . -1)
\once \override TextSpanner.to-barline = ##t
\once \override TextSpanner.bound-details.right.padding = #1.5
<>\startTextSpan
$music
<>\stopTextSpan
\unset Staff.minimumFret
\unset Staff.restrainOpenStrings
#})
barre =
#(define-music-function (parser location strg music)(number? ly:music?)
#{
\set minimumFret = $strg
\set restrainOpenStrings = ##t
\once \override TextSpanner.bound-details.left.text = #(format #f
"B ~@r" strg)
\once \override TextSpanner.font-shape = #'upright
\once \override TextSpanner.bound-details.left.stencil-align-dir-y
= #CENTER
\once \override TextSpanner.style = #'line
\once \override TextSpanner.bound-details.right.text = \markup
\draw-line #'(0 . -1)
\once \override TextSpanner.to-barline = ##t
\once \override TextSpanner.bound-details.right.padding = #1.5
<>\startTextSpan
$music
<>\stopTextSpan
\unset minimumFret
\unset restrainOpenStrings
#})
first = \relative c {
\barreOld 2 { <e a cis>4 a cis fis }
\barre 2 { <e, a cis>4 a cis fis }
}
second = \relative c {
a1 a
}
\score {
\new StaffGroup <<
\new Staff = "guitar" <<
\context Voice = "first voice" { \clef "G_8" \voiceOne \first }
\context Voice = "second voice" { \clef "G_8" \voiceTwo \second }
>>
\new TabStaff = "tab" <<
\context TabVoice = "tab first voice" { \clef "moderntab"
\voiceOne \first }
\context TabVoice = "tab second voice" { \clef "moderntab"
\voiceTwo \second }
>>
>>
}
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user