lilypond-user
[Top][All Lists]
Advanced

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

Re: repeat index


From: bb
Subject: Re: repeat index
Date: Fri, 24 Nov 2017 12:35:20 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0

Do you think that as a proper question for a lilipond user blog? I think a scheme blog might be a better place for that problem.

I cannot help, but what however, whatever do you think that code to do?

Regards

Am 24.11.2017 um 10:45 schrieb Gianmaria Lari:

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

\whatever {c d e f}
\whatever {f e d c}
\whatever {a c e g}

I tried the above code but without success. When I tried it few days ago I was thinking there was some simple to solve problem  and I didn't write you immediately; I wanted to try to solve the problem by myself but I have not been able to do it.

This is the complete code according what you wrote (I hope I didn't introduce any errors):

\version "2.19.80"
scale = {c d e f g a b }

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

\whatever {c d e f}
\whatever {a c e g}

 
It looks that #(ly:make-pitch -1 p) inside this function does not decrease the value of p. So the result is always the same _non transposed_ sequence. There is also a strange (to me) problem with the octave that's too high ( I have been able to solve it but I don't understand why it happens).

The same code outside the function works well:

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

What's the issue?
Thank you, g.


reply via email to

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