lilypond-user
[Top][All Lists]
Advanced

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

Re: Guitar Barre Example


From: Stefan Hackl
Subject: Re: Guitar Barre Example
Date: Sat, 01 Apr 2006 11:09:09 +0200
User-agent: Thunderbird 1.5 (Windows/20051201)

Hello,

I managed to get the solid line. The Makro is now:

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 #{
                           \once \override Voice . TextSpanner #'edge-text =
                             #$(cons (format "C ~a" str) "")
                           \once \override TextSpanner #'dash-fraction = #'()
               \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
                           #}
                           spanned-music))))



Greetings

Stefan

John D. Rimmer schrieb:
Stefan,
 
Thank you -- I'll check it out, tonight.
 
Is there anyone to change the line from dashed to solid?  Or is this all that is possible using the text spanning?  Is there another mechanism for the solid line?
 
Best regards,
 
John

Stefan Hackl <address@hidden> wrote:
Hello,

you can find an example attached to this mail. It runs perfectly with
Lily 2.8.0

Greetings

Stefan Hackl

address@hidden schrieb:
> Stefan,
>
> Thank you for the assist to that question! Would you please e-mail me a .ly file I can test? I tried to use it in one of my files, but it hung up. I'm using v2.7.38
>
> John
>
>
>
\version "2.8.0"
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 #{
\once \override Voice . TextSpanner #'edge-text =
#$(cons (format "C ~a" 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
#}
spanned-music))))

\header {
title = "V. Bourrée"
composer = "J. S. Bach (1685-1750)"
opus = "BWV 996"
subtitle = "aus Lautensuite e-Moll"
mutopiatitle = "V. Bourée"
mutopiacomposer = "BachJS"
mutopiainstrument = "Guitar"
source = "unknown"
style = "Classical"
copyright = "Edited 2006 by Stefan Hackl"
maintainer = "Stefan Hackl"
maintainerEmail = "address@hidden"
lastupdated = "2006/February/26"
tagline = " "
}
\paper {
ragged-last-bottom = ##f
foot-separation = 0.5\cm
left-margin = 2\cm
line-width = 17\cm
}
\layout {
indent = 0\cm
}
\score {
{
\set Staff.midiInstrument = "acoustic guitar (nylon)"
\key e \minor
\clef "G_8"
\relative c'
<<
{
\partial 4
e8
fis
g4
fis8-2
e
dis4-4
e8
fis
b,4
\barre #"II" { cis8-1
dis-4
e4-4
d8-4
c-1
b4
a8-2 }
g
fis4-4
g8
a
b
a
g
fis-4
e4-2
e'8
fis-2
g4
fis8
e
dis4
e8
fis
b,4
cis8
dis8
e4
d8
c
b4
a8-1
g
fis4.-3
g8
g2. \break
\bar ":|:"
b8
g
d'4-4
a8-3
c-1
b4
g'8-4
d-3
e4
b8-4
d-2
c4-2
b8
a-3
gis4
a8
b
c4
b8
a-3
a2.
d8-4
a \break
b4
g'8-4
d-3
e4
b8-4
d-2
c4-2
a'8-4
e-3
fis4-4
cis8-3
e d4-3
cis8-2
b
\once \override Voice.Fingering #'padding = #1.5 \set fingeringOrientations =#'(right) 4.-\trill
b8
b2.
b'8
fis
gis4-4
fis8-2
e
a4-4
e8
g-3
fis4-1
e8
d-3
g4-4
\barre #"III" { d8
f-4 }
e4-3
\barre #"VII" {
a8-4
e-3}
fis4-4
cis8-2
e-0
dis4-4
b2
e8
b \break
c4-2
d8-2
a
b4
c8-1
g
a4
b8
fis
g4
fis8
e-1
dis4-1
e8-1
fis
g4
fis8-4-\trill
e
e2.

} \\
\relative c
{
g8
fis-1
e4
a
b-1
a
g-3
fis-1
e
fis-2
g-3
a
b-1
a
g-3
b-1
e,8
fis-1
g-3
fis
e4
a
b
a
g
fis
e
fis
g
c-2
d-4
d
\set fingeringOrientations =#'(left)2.
g4-3
fis-2
d'
g,-2
b-1
c-2
gis-3
a
d
e-2
a,
e'
e,
a8
b-2
a
g-4
fis4-2
d'
g,-2
b-1
c-2
gis-3
a
cis-1
d
ais-1
b
e
\set fingeringOrientations =#'(right)
fis,
b8-2
ais-1
b-2
cis-4
\set fingeringOrientations =#'(right) \set stringNumberOrientations = #'(down) \override StringNumber #'padding = #3 4
b-2
e-1
d
cis-1
a
d
c-2
b-1
g-1
c-1
b-1
a
fis-1
b4.-1
c8
b
a
gis4-4
a8
e'-3
fis4-3
g,8-4
dis'-2
e4-2
\barre #"II" { fis,8
cis-3 }
dis4-3
e,
a b-2
a b2-1
e,2.


}
>>
\bar ":|"

}
\midi { \tempo 4=120 }
\layout { }

}




reply via email to

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