Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Special pages
LilyPond wiki
Search
Search
Appearance
Create account
Log in
Personal tools
Create account
Log in
Pages for logged out editors
learn more
Contributions
Talk
Editing
Colored arrow
Page
Discussion
English
Read
Edit
Edit source
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
Edit source
View history
General
What links here
Related changes
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
This snippet demonstrates drawing colored arrows in a score, e.g. for analysis purposes. These arrows have a fixed length and angle. If you prefer arrows that adapt to layout changes, please also have a look at snippet 962. <lilypond version="2.24.0"> % http://lsr.di.unimi.it/LSR/Item?u=1&id=961 %% => http://lilypond.1069038.n5.nabble.com/scheme-problem-colored-background-layers-tc169023.html #(define-markup-command (Arrow layout props color angle length moveX moveY) (color? number? number? number? number?) (interpret-markup layout props #{ \markup { \with-dimensions #'(0 . 0) #'(0 . 0) \translate #(cons moveX moveY) \rotate #angle \override #'(thickness . 5) % line thickness \fontsize #10 % arrow-head size \with-dimensions #'(0 . 0) #'(0 . 0) \with-color $color \translate #(cons 0 (- 0 length)) \combine \draw-line #(cons 0 length) % can be replaced by \draw-dashed-line or \draw-dotted-line \translate-scaled #'(0 . -0.5) % might have to be adjusted if line thickness is changed \with-color $color \arrow-head #Y #DOWN ##t % ##t - filled arrow-head, ##f - empty arrow-head } #})) {<< \new Staff {R1*3} \new Staff { e'1-\tweak layer #-1 -\markup {\Arrow #green #138 #16 #2 #2 } e'1-\tweak layer #-1 -\markup {\Arrow #cyan #255 #14 #-1 #2 } e'1-\tweak layer #2 -\markup {\Arrow #red #172 #11 #1 #2 } % To have the arrow behind the staff, choose a value below 0 for the layer. % If you want the arrows to cover the notes, choose a value of 2 or more. } >>} </lilypond> [[Category:Education]] [[Category:Editorial annotations]] [[Category:Tweaks and overrides]] [[Category:Specific notation]] [[Category:Syntax and expressions]]
Summary:
Please note that all contributions to LilyPond wiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
Meta:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Search
Search
Editing
Colored arrow
Add topic