lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Fwd: list of accordion registers as a single markup


From: Jean Abou Samra
Subject: Fwd: list of accordion registers as a single markup
Date: Sat, 23 Jan 2021 21:01:27 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.5.0

Hi!
I need to obtain a list of accordion registers.


I know I can engrave them using:

#(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"
}

But I want to pass them in a markup function as a list.

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?

thanks
Davide

Hi,

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]