I had made the barre parts of the following script and post it on
lilypond wiki for guitar barres. It had worked fine from lilypond 2.6
to 2.10, last week I had try to use it on 2.12 and it did not print
nothing.

Can some one help me fix it?

Thanks,

-- 
Allan.
O mundo pode ser melhor se acreditarmos nele.
%% To avoid typing rightHandFinger... everytime Just type -\RH #"finger"
#(define RH rightHandFinger )
%% Extra padding for right hand finger placed right
padrh = { \once \override StrokeFinger #'padding = #1.5  }
%% Extra padding for right hand finger placed left
padlh = { \once \override Fingering #'padding = #1.8 }
%% Place stroke finger above the note
rhu = { \set strokeFingerOrientations = #'(up) }
%% Place stroke finger right from the note
rhr = { \set strokeFingerOrientations = #'(right) }
%% Place stroke finger below the note
rhd = { \set strokeFingerOrientations = #'(down) }
%% Place stroke finger for the next note only below the note
orhd = { \once \set strokeFingerOrientations = #'(down) }
%% Make digits for fingering small
lhsmall = { \override Fingering #'font-size = #-6 }
%% Make letters for fingering larger
rhbig = { \override StrokeFinger #'font-size = #0.6 }
%% Place fingerings for the next notes left from the notes
lhl = { \set fingeringOrientations = #'(left)}
%% Place fingerings for the next notes right from the notes
lhr = { \set fingeringOrientations = #'(right)}
%% Place fingerings for the next notes above the notes
lhu = { \set fingeringOrientations = #'(up)}
%% Place fingerings for the next notes below the notes
lhd = { \set fingeringOrientations = #'(down)}
%% Make the lyrics text small
lyricsmall = { \override LyricText #'font-size = #-1 }
%% Put the string number indications below the notes
snd = { \set stringNumberOrientations = #'(down) }
%% Put the string number indications above the notes
snu = { \set stringNumberOrientations = #'(up) }
%% Put the string number indications below the notes
snl = { \set stringNumberOrientations = #'(left) }
%% Put the string number indications above the notes
snr = { \set stringNumberOrientations = #'(right) }
%% Put a barre at some notes in the music
barre = #(define-music-function (barre location str music) (string? ly:music?)
           (let ((spanned-music
                   (let ((first-element #f)
                         (last-element #f)
                         (first-found? #f))
                     (music-map (lambda (m)
                                  (if (eqv? (ly:music-property m 'name) 'EventChord)
                                      (begin
                                        (if (not first-found?)
                                            (begin
                                              (set! first-found? #t)
                                              (set! first-element m)))
                                        (set! last-element m)))
                                  m)
                                music)
                     (if first-found?
                         (begin
                           (set! (ly:music-property first-element 'elements)
                                 (cons (make-music 'TextSpanEvent 'span-direction -1)
                                       (ly:music-property first-element 'elements)))
                           (set! (ly:music-property last-element 'elements)
                                 (cons (make-music 'TextSpanEvent 'span-direction 1)
                                       (ly:music-property last-element 'elements)))))
                     music)))
             (make-music 'SequentialMusic
               'origin location
               'elements (list #{

	       		   \override Voice . TextSpanner #'edge-text =
	                     #(cons ( markup (#:musicglyph "timesig.C44") #:normal-text #:vcenter
			     $str ) "" )

                           \once \override Voice . TextSpanner #'direction = #1
                           \once \override Voice . TextSpanner #'edge-height = #'(0 . 0.5)
                           \once \override Voice . TextSpanner #'padding = #3
                           \once \override Voice . TextSpanner #'enclose-bounds = #1
			   \once \override Voice . TextSpanner #'dash-fraction = #'()

                           #}
                           spanned-music))))
%% Put a half-barre at some notes in the music
hbarre = #(define-music-function (hbarre location str music) (string? ly:music?)
           (let ((spanned-music
                   (let ((first-element #f)
                         (last-element #f)
                         (first-found? #f))
                     (music-map (lambda (m)
                                  (if (eqv? (ly:music-property m 'name) 'EventChord)
                                      (begin
                                        (if (not first-found?)
                                            (begin
                                              (set! first-found? #t)
                                              (set! first-element m)))
                                        (set! last-element m)))
                                  m)
                                music)
                     (if first-found?
                         (begin
                           (set! (ly:music-property first-element 'elements)
                                 (cons (make-music 'TextSpanEvent 'span-direction -1)
                                       (ly:music-property first-element 'elements)))
                           (set! (ly:music-property last-element 'elements)
                                 (cons (make-music 'TextSpanEvent 'span-direction 1)
                                       (ly:music-property last-element 'elements)))))
                     music)))
             (make-music 'SequentialMusic
               'origin location
               'elements (list #{

	       		   \override Voice . TextSpanner #'edge-text =
	                     #(cons ( markup (#:musicglyph "timesig.C22") #:normal-text #:vcenter
			     $str ) "" )

                           \once \override Voice . TextSpanner #'direction = #1
                           \once \override Voice . TextSpanner #'edge-height = #'(0 . 0.5)
                           \once \override Voice . TextSpanner #'padding = #3
                           \once \override Voice . TextSpanner #'enclose-bounds = #1
			   \once \override Voice . TextSpanner #'dash-fraction = #'()

                           #}
                           spanned-music))))
%% markup macros for barre and half barre signal in one chord
#(define-markup-command (lbarre layout props str) (string?)
 (interpret-markup layout props (markup #:musicglyph "timesig.C44" #:vcenter str)))

#(define-markup-command (lhbarre layout props str) (string?)
 (interpret-markup layout props (markup #:musicglyph "timesig.C22" #:vcenter str)))

tempoMark = #(define-music-function (parser location padding marktext)
  (number? string?)
  #{
    \once \override Score . RehearsalMark #'padding = $padding
    \once \override Score . RehearsalMark #'no-spacing-rods = ##t
    \mark \markup { \small \bold $marktext }
  #})

rhi = RH #"i"
_______________________________________________
lilypond-user mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to