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 15:18:50 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

Gianmaria Lari <address@hidden> writes:

> On 20 November 2017 at 12:00, David Kastrup <address@hidden> wrote:
>
>> Gianmaria Lari <address@hidden> writes:

>> > 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))
>> }
>
> Thank you David, it works perfectly!
>
> Is there any way to encapsulate it in a function to avoid to write all the
> code any time I need it?

What is "all the code"?  I really have no idea what makes you consider
something simple (and your "explanation" below does not help at all
since it is tantamount to "simple depends on the viewer's metrics").
I also have no idea what part of the above you consider "it" to be
encapsulated and what you consider variable.

> Regarding "simple". Never think seriously about what I mean with "simple".
> Maybe:
>
> Suppose that you know well how to informally solve a problem.  Now
> suppose you have to describe your solution in a formal and algorithmic
> way.
>
> Between many formal solution I would say that the simplest one is that one
> that better overlap the informal solution.
> g.

-- 
David Kastrup



reply via email to

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