[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Creating pizz and arco markup macros
From: |
Olivier Biot |
Subject: |
Re: Creating pizz and arco markup macros |
Date: |
Mon, 22 Oct 2012 18:36:42 +0200 |
Dear all,
Apparently the LilyPond snippets have disappeared from my post.
Here's a rendering of my previous message with the missing snippets in
place, sent from my mail account:
Is there any better way to create pizzicato and arco macros than with
a TextSpanner?
Here's the code I defined in a separate 'layout.ly' file:
<raw>
pizzicato = "pizz."
arco = "arco"
playingModeSpanner =
#(define-music-function (parser location annotation) (string?)
#{
\override TextSpanner #'style = #'none
\override TextSpanner #'direction = #DOWN
\override TextSpanner #'(bound-details left-broken text) = ##f
\override TextSpanner #'(bound-details left stencil-align-dir-y) = #CENTER
\override TextSpanner #'(bound-details left text) = \markup {
\italic $annotation }
#}
)
</raw>
I use the macro as follows:
<raw>
\new Staff \with {midiInstrument = #"pizzicato strings"} {
\relative c, {
\key f \major
\clef "bass"
\playingModeSpanner \pizzicato
f4\startTextSpan r f f' f,4 r f f' c, r c' a' c,, r c' c'
\stopTextSpan
}
}
</raw>
Best regards,
Olivier