[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lilypond-user
Subject:    =?iso-8859-1?Q?Problems_with_Barr=E9?=
From:       <sir.teddy.the.first () gmail ! com>
Date:       2020-10-27 8:58:43
Message-ID: 000201d6ac3f$5f83f950$1e8bebf0$ () gmail ! com
[Download RAW message or body]

This is a multipart message in MIME format.

[Attachment #2 (multipart/alternative)]


Hi all,

I’m using  <http://lsr.di.unimi.it/LSR/Item?id=632> this barré-function from
the LSR and I’m trying to make it work when the first note (or the last one)
is a rest.

 

Here’s the code:

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

\version "2.20.0"

guitbarre =

#(define-music-function (barre location str music) (string? ly:music?)

  (let ((elts (extract-named-music music '(NoteEvent EventChord))))

        (if (pair? elts)

            (let ((first-element (first elts))

                  (last-element (last elts)))

              (set! (ly:music-property first-element 'articulations)

                    (cons (make-music 'TextSpanEvent 'span-direction -1)

                          (ly:music-property first-element 'articulations)))

              (set! (ly:music-property last-element 'articulations)

                    (cons (make-music 'TextSpanEvent 'span-direction 1)

                          (ly:music-property last-element
'articulations))))))

      #{

          \once \override TextSpanner.font-shape = #'upright

          \once \override TextSpanner.staff-padding = #3

          \once \override TextSpanner.style = #'line

          \once \override TextSpanner.to-barline = ##f

          \once \override TextSpanner.bound-details =

               #`((left

                   (text . ,#{ \markup { \raise #-.5 \concat { \bold { #str
" " }}} #})

                   (Y . 0)

                   (padding . .25)

                   (attach-dir . -2))

                  (right

                   (text . ,#{ \markup { \draw-line #'( 0 . -1) } #})

                   (Y . 0)

                   (padding . 0.25)

                   (attach-dir . 2)))

         $music

      #})

 

\relative c' {

  %1       <-- This one works

  \guitbarre #"VI" { g4 g4 g4 g4 }

 

  %2 <-- This one does not

  <<

    \new Voice \guitbarre #"I" {\voiceOne r4 <f' a c>4  4 4}

    \new Voice {\voiceTwo f,1}

  >>

}

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

 

What do I have to change or is there some other trick to make it work?

 

Thanks In Advance


[Attachment #5 (text/html)]

<html xmlns:v="urn:schemas-microsoft-com:vml" \
xmlns:o="urn:schemas-microsoft-com:office:office" \
xmlns:w="urn:schemas-microsoft-com:office:word" \
xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" \
xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type \
content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word \
15 (filtered medium)"><style><!-- /* Font Definitions */
@font-face
	{font-family:"Cambria Math";
	panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
	{font-family:Calibri;
	panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
	{margin:0cm;
	margin-bottom:.0001pt;
	font-size:11.0pt;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
	{mso-style-priority:99;
	color:#0563C1;
	text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
	{mso-style-priority:99;
	color:#954F72;
	text-decoration:underline;}
span.E-MailFormatvorlage17
	{mso-style-type:personal-compose;
	font-family:"Calibri",sans-serif;
	color:windowtext;}
.MsoChpDefault
	{mso-style-type:export-only;
	font-family:"Calibri",sans-serif;
	mso-fareast-language:EN-US;}
@page WordSection1
	{size:612.0pt 792.0pt;
	margin:70.85pt 70.85pt 2.0cm 70.85pt;}
div.WordSection1
	{page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=DE link="#0563C1" \
vlink="#954F72"><div class=WordSection1><p class=MsoNormal>Hi all,<o:p></o:p></p><p \
class=MsoNormal><span lang=EN-GB>I&#8217;m using </span><a \
href="http://lsr.di.unimi.it/LSR/Item?id=632"><span lang=EN-GB>this</span></a> <span \
lang=EN-GB>barré-function from the LSR and I&#8217;m trying to make it work when the \
first note (or the last one) is a rest.<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>Here&#8217;s the code:<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>\version &quot;2.20.0&quot;<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>guitbarre =<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>#(define-music-function (barre location str music) \
(string? ly:music?)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>  (let \
((elts (extract-named-music music '(NoteEvent EventChord))))<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>        (if (pair? elts)<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>            (let ((first-element (first \
elts))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                  \
(last-element (last elts)))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB> \
(set! (ly:music-property first-element 'articulations)<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>                    (cons (make-music 'TextSpanEvent \
'span-direction -1)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>         \
(ly:music-property first-element 'articulations)))<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>              (set! (ly:music-property last-element \
'articulations)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>             \
(cons (make-music 'TextSpanEvent 'span-direction 1)<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>                          (ly:music-property \
last-element 'articulations))))))<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>      #{<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>         \
\once \override TextSpanner.font-shape = #'upright<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>          \once \override TextSpanner.staff-padding \
= #3<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>          \once \
\override TextSpanner.style = #'line<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>          \once \override TextSpanner.to-barline = \
##f<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>          \once \
\override TextSpanner.bound-details =<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>               #`((left<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>                   (text . ,#{ \markup { \raise #-.5 \concat { \bold { \
#str &quot; &quot; }}} #})<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>  \
(Y . 0)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                   \
(padding . .25)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>             \
(attach-dir . -2))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>          \
(right<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                   \
(text . ,#{ \markup { \draw-line #'( 0 . -1) } #})<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>                   (Y . 0)<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>                   (padding . \
0.25)<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>                   \
(attach-dir . 2)))<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>         \
$music<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>      \
#})<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal>\relative c' \
{<o:p></o:p></p><p class=MsoNormal><span lang=EN-GB>  %1       &lt;-- This one \
works<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>  \guitbarre \
#&quot;VI&quot; { g4 g4 g4 g4 }<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB>  %2 \
&lt;-- This one does not<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>  \
&lt;&lt;<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>    \new Voice \
\guitbarre #&quot;I&quot; {\voiceOne r4 &lt;f' a c&gt;4  4 4}<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB>    \new Voice {\voiceTwo \
f,1}<o:p></o:p></span></p><p class=MsoNormal><span lang=EN-GB>  \
&gt;&gt;<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>}<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%<o:p></o:p></span></p><p \
class=MsoNormal><span lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span \
lang=EN-GB>What do I have to change or is there some other trick to make it \
work?<o:p></o:p></span></p><p class=MsoNormal><span \
lang=EN-GB><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span lang=EN-GB>Thanks In \
Advance<o:p></o:p></span></p></div></body></html>


["Barre.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic