|
From: | Davide Bonetti |
Subject: | Re: Fwd: list of accordion registers as a single markup |
Date: | Sat, 23 Jan 2021 21:23:58 +0100 |
User-agent: | Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.1 |
Thanks to both of you!
Davide
Hi!I need to obtain a list of accordion registers.
I know I can engrave them using:
But I want to pass them in a markup function as a list.#(use-modules (scm accreg))
\markup \line {\discant "1"\discant "10"\discant "101"\discant "121"\discant "21"\discant "11"\discant "120"\discant "110"\discant "1+0"\discant "100"\discant "11+0"}
regList = #'("1" "10" "101" "121" "21" "11" "120" "110" "1+0" "100" "11+0")
I've tried map, for-each, do, let loop.... but I can't find a way to do this.
Someone can help me?
thanksDavideHi,
Just to add to Harm's answer, there is list splicing, like this:
\version "2.23.0"
#(use-modules (scm accreg))
regList = #'("1" "10" "101" "121" "21" "11" "120" "110" "1+0" "100" "11+0")
\markup \line {
#@(map (lambda (s) #{ \markup \discant #s #}) regList)
\eyeglasses
}
% Alternate method
% (https://lilypond.org/doc/v2.22/Documentation/extending/how-markups-work-internally)
\markup \line {
#@(map make-discant-markup regList)
\eyeglasses
}
The advantage is that you can have more than just this list of arguments in the \line (I put \eyeglasses for the sake of example).See https://lilypond.org/doc/v2.22/Documentation/extending/lilypond-scheme-syntax
Best,
Jean
[Prev in Thread] | Current Thread | [Next in Thread] |