lilypond-user
[Top][All Lists]
Advanced

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

Re: repeat index


From: David Kastrup
Subject: Re: repeat index
Date: Mon, 20 Nov 2017 12:00:33 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> I have this:
>
> \version "2.19.80"
>
> scale = {c d e f g a b}
> pattern = {c d e f}
>
> \fixed c' {
>   \modalTranspose c c \scale \pattern
>   \modalTranspose c d \scale \pattern
>   \modalTranspose c e \scale \pattern
>   \modalTranspose c f \scale \pattern
>   \modalTranspose c g \scale \pattern
>   \modalTranspose c a \scale \pattern
>   \modalTranspose c b \scale \pattern
>   \modalTranspose c c' \scale \pattern
> }
>
> Is there any (simple) way to rewrite it in a more concise way like this for
> example?
>
>   \repeat unfold 7 {
>     \modalTranspose c "c+index" \scale \pattern
>   }

What is simple?

\version "2.18.0"

scale = {c d e f g a b}
pattern = {c d e f}

\fixed c' {
  #@(map
      (lambda (p)
        #{ \modalTranspose c #(ly:make-pitch -1 p) \scale \pattern #})
      (iota 8))
}

-- 
David Kastrup



reply via email to

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