Hi Gianamari,

Add a numerical parameter.


    \version "2.19.81"
    multiModal = #(define-music-function (scale patternMelodic num)
(ly:music? ly:music? number?)
               #{
                 #@(map(lambda (p)
                   #{ \modalTranspose c #(ly:make-pitch -1 p) $scale
$patternMelodic #})
                 (iota num))
               #})

    scale = {c d e f g a b}

    \score {
      \multiModal \scale {c' d' c' r} 5
      \layout {}
    }

Andrew



On 10 March 2018 at 09:26, Gianmaria Lari <gianmarial...@gmail.com> wrote:

> This function transpose modally some music in the seven degrees of the
> scale:
>
> \version "2.19.81"
> multiModal = #(define-music-function (scale patternMelodic) (ly:music?
> ly:music?)
>            #{
>              #@(map(lambda (p)
>                #{ \modalTranspose c #(ly:make-pitch -1 p) $scale
> $patternMelodic #})
>              (iota 7))
>            #})
>
> scale = {c d e f g a b}
>
> \score {
>   \multiModal \scale {c' d' c' r}
>   \layout {}
> }
>
>
> If I want to make the transposition only for the first three degrees of
> the scale I have to change
>
> (iota 7)
>
> to
>
> (iota 3)
>
> What if I want to pass to the function the number of transposition ? So
> that if I want the first four transpositions I could write something like
>
>
>   \multiModal \scale {c' d' c' r} 4
>
> ?
>
> Thank you, g.
>
>
> _______________________________________________
> lilypond-user mailing list
> lilypond-user@gnu.org
> https://lists.gnu.org/mailman/listinfo/lilypond-user
>
>
_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to