Thanks to both of you!

Davide

Il 23/01/2021 21:01, Jean Abou Samra ha scritto:

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



--
Questa e-mail è stata controllata per individuare virus con Avast antivirus.
https://www.avast.com/antivirus

Reply via email to