[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: custom articulation position
From: |
Caagr98 |
Subject: |
Re: custom articulation position |
Date: |
Fri, 3 Nov 2017 17:02:53 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 |
What you're doing is just creating a text script, not an articulation. I use
the following code to create a custom real articulation; you'll obviously have
to adapt some of it to fit yours.
```
#(define (draw-unaccent grob)
(let ((stil (make-path-stencil '(M -0.435 0.435 C -0.435 0.185 -0.250 0 0 0
C 0.250 0 0.435 0.185 0.435 0.435) 0.13 1 1 #f))
(dir (ly:grob-property grob 'direction CENTER)))
(if (= dir DOWN)
(ly:stencil-scale stil 1 -1)
stil)))
#(define unaccent-script-alist
(cons `("unaccent" .
((avoid-slur . around)
(padding . 0.30)
(side-relative-direction . ,DOWN)
))
default-script-alist))
\layout {
\context {
\Score
scriptDefinitions = #unaccent-script-alist
}
}
unaccent =
-\tweak stencil #draw-unaccent
#(make-articulation "unaccent" 'midi-extra-velocity -30)
```
On 11/03/17 16:57, Gilberto Agostinho wrote:
> Hi all,
>
> I am having a bit of trouble trying to create a custom articulation in
> LilyPond. At the moment I have the following code:
>
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
> \version "2.19.53"
>
> doubleAccent = \markup {
> \halign #-0.72
> \combine
> \musicglyph #"scripts.sforzato"
> \raise #1.1
> \musicglyph #"scripts.sforzato"
> }
>
> {
> \time 3/4
> \stemUp
> a-\doubleAccent
> a'-\doubleAccent
> a''-\doubleAccent
> \stemDown
> a-\doubleAccent
> a'-\doubleAccent
> a''-\doubleAccent
> }
> \markup{""} % just for spacing
> {
> \time 3/4
> \stemUp
> a->
> a'->
> a''->
> \stemDown
> a->
> a'->
> a''->
> }
> %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
>
> Outputting:
>
> <http://lilypond.1069038.n5.nabble.com/file/t4165/12.png>
>
> This does work well, but the new symbol does not automatically respond to
> the stem position like a regular accent (compare both systems above). I know
> that I can manually force their position with ^\doubleAccent and
> _\doubleAccent, but I want to ask if is there any way of doing this
> automagically. Does anyone have any suggestions?
>
> And also, is there a way of associating a dynamic change to this new symbol
> so that it also affects the MIDI output?
>
> Many thanks!
> Gilberto
>
>
>
> --
> Sent from: http://lilypond.1069038.n5.nabble.com/User-f3.html
>
> _______________________________________________
> lilypond-user mailing list
> address@hidden
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>