However, in version 2.18.2, I discovered that I had to change the markup
definition of essai slightly:
%<-------------- SNIP -------------
\version "2.18.2"
%% Nothing realistic here, 'essai' is just to show something:
essai =
\markup
*\center-align % <--- not needed in latest unstable*
\scale #'(-2 . -2)
\override #'(filled . #t)
\path #0.01
#'((moveto 0.58 0.91)
(curveto 0.58 0.83 0.63 0.80 0.70 0.80)
(curveto 0.90 0.80 0.87 1.15 1.11 1.28)
(curveto 0.90 1.29 0.58 1.11 0.58 0.91))
%% New articulation:
#(append! default-script-alist
(list
`("mon-articulation"
. (
(text . ,#{ \markup \essai #})
(stencil . ,ly:text-interface::print)
; any other properties
(toward-stem-shift-in-column . 0.0)
(padding . 0.30)
(avoid-slur . around)
;(script-priority . 100)
(direction . ,UP)))))
monArticulation = #(make-articulation "mon-articulation")
{
% this is what happens when treated as
% a markup with other scripts (notice
% the order and mis-alignment)
c'^\essai^>^!
% this is what happens when treated as
% a script/articulation with other scripts
% (alignment is correct and order can
% be controlled with "script-priority" property)
c'\monArticulation^>^!
}
\layout {
\context {
\Score
scriptDefinitions = #default-script-alist
}
}
%<-------------- SNIP -------------
- Abraham
On Mon, Apr 6, 2015 at 11:15 AM, tisimst <[email protected]> wrote:
> This worked for me:
>
> %<-------------- SNIP -------------
>
> #(append! default-script-alist
> (list
> `("mon-articulation"
> . (
> (text . ,#{ \markup \essai #})
> (stencil . ,ly:text-interface::print)
> ; any other properties
> (toward-stem-shift-in-column . 0.0)
> (padding . 0.20)
> (avoid-slur . around)
> (direction . ,UP)))))
>
> %<-------------- SNIP -------------
>
> HTH,
> Abraham
>
> On Mon, Apr 6, 2015 at 7:13 AM, Schneidy [via Lilypond] <[hidden email]
> <http:///user/SendEmail.jtp?type=node&node=174125&i=0>> wrote:
>
>> Hi All,
>>
>> I've followed this conversation with a lot of interest:
>>
>> http://lilypond.1069038.n5.nabble.com/Creating-new-articulation-adding-to-an-internal-alist-td172689.html
>>
>> However, there's something I'm missing.
>> I'm trying to put my own glyph into a new articulation script without
>> success: I still have to go through the feta glyph and change the stencil
>> afterward.
>> Is there a simple way to avoid this additional workaround ?
>>
>> TIA
>> Pierre
>>
>> %%%% Snippet %%%%
>> \version "2.19.2"
>>
>> %% Nothing realistic here, 'essai' is just to show something:
>> essai =
>> \markup
>> \scale #'(-2 . -2)
>> \override #'(filled . #t)
>> \path #0.01
>> #'((moveto 0.58 0.91)
>> (curveto 0.58 0.83 0.63 0.80 0.70 0.80)
>> (curveto 0.90 0.80 0.87 1.15 1.11 1.28)
>> (curveto 0.90 1.29 0.58 1.11 0.58 0.91))
>>
>>
>> %% New articulation:
>> #(append! default-script-alist
>> (list
>> `("mon-articulation"
>> . (
>> ;; In order to put my own glyph named 'essai'
>> ;; I want to modify this line:
>> (script-stencil . (feta . ("thumb" . "thumb")))
>> ; any other properties
>> (toward-stem-shift-in-column . 0.0)
>> (padding . 0.20)
>> (avoid-slur . around)
>> (direction . ,UP)))))
>>
>> monArticulation = #(make-articulation "mon-articulation")
>>
>> %% workaround to show what I'd like to get:
>> monArticulation-workaround =
>> #(define-event-function
>> (parser location)
>> ()
>> #{
>> -\tweak stencil #(lambda
>> (grob)
>> (grob-interpret-markup grob essai))
>> \monArticulation
>> #})
>>
>>
>> {
>> c'\monArticulation
>> c'\monArticulation-workaround
>> }
>>
>> \layout {
>> \context {
>> \Score
>> scriptDefinitions = #default-script-alist
>> }
>> }
>>
>> %%%%%%%%%%%%%%%%%%%%%%
>>
>>
>> _______________________________________________
>> lilypond-user mailing list
>> [hidden email] <http:///user/SendEmail.jtp?type=node&node=174112&i=0>
>> https://lists.gnu.org/mailman/listinfo/lilypond-user
>> ~Pierre
>>
>>
>> ------------------------------
>> If you reply to this email, your message will be added to the
>> discussion below:
>>
>> http://lilypond.1069038.n5.nabble.com/Custom-glyph-articulation-WAS-Creating-new-articulation-adding-to-an-internal-alist-tp174112.html
>> To start a new topic under User, email [hidden email]
>> <http:///user/SendEmail.jtp?type=node&node=174125&i=1>
>> To unsubscribe from Lilypond, click here.
>> NAML
>> <http://lilypond.1069038.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
> ------------------------------
> View this message in context: Re: Custom glyph articulation [WAS:
> Creating new articulation (adding to an internal alist) ]
> <http://lilypond.1069038.n5.nabble.com/Custom-glyph-articulation-WAS-Creating-new-articulation-adding-to-an-internal-alist-tp174112p174125.html>
> Sent from the User mailing list archive
> <http://lilypond.1069038.n5.nabble.com/User-f3.html> at Nabble.com.
>
> _______________________________________________
> lilypond-user mailing list
> [email protected]
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user