[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guitar notation - scheme function for slurs with markup
From: |
Lukas-Fabian Moser |
Subject: |
Re: Guitar notation - scheme function for slurs with markup |
Date: |
Sun, 29 May 2022 23:27:05 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 |
Hi Stefan,
Am 29.05.22 um 22:42 schrieb Stefan E. Mueller:
I am not sure yet what the difference between a scheme-function and a
music-function is (the second example seems to work whichever definition
is chosen).
A music function must return music, a scheme function can return more
general expressions (for instance, a new function or a list of symbols).
The "-" dash in my case added an (unwanted) accentuation to
the first note, I get the slur with the markup without the accent only if
I remove it (not sure what it is supposed to do - manual says it is a
required
named direction indicator, but in my version 2.22.1 it doesn't work
like that).
Ah, I thought you wanted the accent. :-)
Both the - and ^ symbols have various meanings; it's important to read
them in order.
Add articulation with neutral direction/up-facing/down-facing: -!, ^!,
_! (here I use ! = staccatissimo as an articulation, but ( = slur, ^ =
marcato and - = tenuto are other examples)
If you just want a slur that should have its direction forced upwards,
just write ^(
I thought the function-constructs were merely doing variable
substitutions, but it seems there is more to this. Because now I have the
problem how to describe several hammer-ons in a row with a function, like
this:
\new Staff {
e''8^(^\markup {\halign #-1.5 ho} f''8)^\markup {\halign #-1.5 ho} g''\8)
}
Ideally, I'd like to be able to write this like
e''8 \ho f''8 \ho g''8
(with the corresponding closing brackets also provided by the function,
but it may be that this is not possible).
I assume you want another slur to start on the f''? Then maybe something
like this:
\version "2.22"
ho =
#(define-music-function (spacing music) ((number? -1.5) ly:music?)
#{
<>^(^\markup {\halign #spacing ho}
#music
<>)
#})
\new Staff {
e''8 \ho f''8 \ho g''8 a''
}
Lukas