lilypond-user
[Top][All Lists]
Advanced

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

scheme modalTranspose


From: Gianmaria Lari
Subject: scheme modalTranspose
Date: Fri, 9 Mar 2018 23:26:08 +0100

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.


reply via email to

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