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

List:       lilypond-user
Subject:    Problem to write a function for markup
From:       Jacques Menu <imj-muzhic () bluewin ! ch>
Date:       2014-11-25 22:21:12
Message-ID: C699C2D2-E154-4F9E-B9F4-DFAD603AD63E () bluewin ! ch
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Hello folks,

I tried the following to obtain a centered, colored fingering indication:

%%%%%%%%%%%%%%%%
\version "2.18.2"

doigte =
#(define-music-function
(parser location music doigte)
(ly:music? markup?)
#{
\once\override TextScript.self-alignment-X = #CENTER
#music ^\markup{\large\bold #doigte}
#})

{
\clef "bass" \key as \major \time 4/4 | % 1
\tempo "March Tempo" 4 = 104-108

\once\override TextScript.self-alignment-X = #CENTER
\once\override TextScript.color = #blue
f8 \mf ^\markup{\large\bold "3D"}
% \doigte f8 "3D" \mf
}
%%%%%%%%%%%%%%%%

but calling the function with:

\doigte f8 "3D"

leads to error:

/Users/menu/Documents/LaTeX/PartitionsLilypond/FunctionForMarkupProblem.ly:9:12 \
<applewebdata://00514FEF-AE28-46AA-88B5-D222FF8FC2C5/0>: Erreur : syntax error, \
unexpected '^' #music
^\markup{\large\bold #doigte}

Thanks for your help!

JM

--

Jacques Menu
Ch. de la Pierre 12
1023 Crissier

mailto:imj-219@bluewin.ch


[Attachment #5 (unknown)]

<html><head><meta http-equiv="Content-Type" content="text/html \
charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: \
space; -webkit-line-break: after-white-space;" class="">Hello folks,<div class=""><br \
class=""></div><div class="">I tried the following to obtain a centered, colored \
fingering indication:</div><div class=""><br class=""></div><div \
class="">%%%%%%%%%%%%%%%%</div><div class=""><div style="margin: 0px;" \
class=""><!--StartFragment-->\version "2.18.2"</div><div style="margin: 0px;" \
class=""><br class=""></div><div style="margin: 0px;" class="">doigte =</div><div \
style="margin: 0px;" class="">#(define-music-function</div><div style="margin: 0px;" \
class="">  (parser location music doigte)</div><div style="margin: 0px;" class="">  \
(ly:music? markup?)</div><div style="margin: 0px;" class="">  #{</div><div \
style="margin: 0px;" class="">    \once\override TextScript.self-alignment-X = \
#CENTER</div><div style="margin: 0px;" class="">    #music ^\markup{\large\bold \
#doigte}</div><div style="margin: 0px;" class="">  #})</div><div style="margin: 0px;" \
class=""><br class=""></div><div style="margin: 0px;" class="">{</div><div \
style="margin: 0px;" class="">  \clef "bass" \key as \major \time 4/4 | % 1</div><div \
style="margin: 0px;" class="">  \tempo "March Tempo" 4 = 104-108</div><div \
style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" class="">  \
\once\override TextScript.self-alignment-X = #CENTER</div><div style="margin: 0px;" \
class="">  \once\override TextScript.color = #blue</div><div style="margin: 0px;" \
class="">  f8 \mf ^\markup{\large\bold "3D"}</div><div style="margin: 0px;" class=""> \
%  \doigte f8 "3D" \mf</div><div style="margin: 0px;" class="">}</div><div \
style="margin: 0px;" class="">%%%%%%%%%%%%%%%%<!--EndFragment--></div></div><div \
style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" \
class="">but calling the function with:</div><div style="margin: 0px;" class=""><br \
class=""></div><div style="margin: 0px;" class="">\doigte f8 "3D"</div><div \
style="margin: 0px;" class=""><br class=""></div><div style="margin: 0px;" \
class="">leads to error:</div><div style="margin: 0px;" class=""><br \
class=""></div><div style="margin: 0px;" class=""><div style="margin: 0px;" \
class=""><!--StartFragment--><a href="0" class=""><span style="font-size: 10pt;" \
class="">/Users/menu/Documents/LaTeX/PartitionsLilypond/FunctionForMarkupProblem.ly:9:12</span></a><span \
style="font-size: 10pt;" class="">: Erreur : syntax error, unexpected \
'^'</span></div><div style="margin: 0px;" class=""><span style="font-size: 10pt;" \
class="">    #music </span></div><div style="margin: 0px;" class=""><span \
style="font-size: 10pt;" class="">           ^\markup{\large\bold \
#doigte}</span></div><div style="margin: 0px;" class=""><br \
class=""><!--EndFragment--></div><div style="margin: 0px;" class=""><font size="2" \
class="">Thanks for your help!</font></div><div style="margin: 0px;" class=""><font \
size="2" class=""><br class=""></font></div></div>JM<br class=""><br class=""><div \
apple-content-edited="true" class=""><div style="color: rgb(0, 0, 0); font-family: \
Menlo;  font-style: normal; font-variant: normal; font-weight: normal; \
letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; \
text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: \
0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: \
break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " \
class=""><span class="Apple-style-span" style="border-collapse: separate; color: \
rgb(0, 0, 0); font-variant: normal; letter-spacing: normal; line-height: normal; \
orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; \
white-space: normal; widows: 2; word-spacing: 0px; border-spacing: 0px; \
-webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; \
-webkit-text-stroke-width: 0px; "><div style="word-wrap: break-word; \
-webkit-nbsp-mode: space; -webkit-line-break: after-white-space; " class="">--<br \
class=""><br class="">Jacques Menu<br class="">Ch. de la Pierre 12<br class="">1023 \
Crissier<br class=""><br class=""><a href="mailto:imj-219@bluewin.ch" \
class="">mailto:imj-219@bluewin.ch</a><br class=""><br class=""><br class=""><br \
class=""></div></span></div> </div>
<br class=""></body></html>



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user


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

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