lilypond-user
[Top][All Lists]
Advanced

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

Re: marche unitonale


From: Rune Zedeler
Subject: Re: marche unitonale
Date: Mon, 18 Dec 2006 23:58:02 +0100
User-agent: Thunderbird 1.5.0.8 (X11/20061117)

yota moteuchi wrote:
How do I do with lilypond what it's called in french : "marche
unitonale" (that I can not translate in english)

I did that long time ago:
http://www.mail-archive.com/address@hidden/msg00067.html

Here the file is converted to 2.10 (only tested on 2.11 but guess it should work):

\version "2.10.0"


#(define  ((shift-pitch amount) p)
  (let* ((o (ly:pitch-octave p))
         (a (ly:pitch-alteration p))
         (n (ly:pitch-notename p)))

    (set! n (+ amount n))
    (while (< n 0) (begin (set!  o (- o 1)) (set! n (+ n 7))))
    (while (> n 6) (begin (set!  o (+ o 1)) (set! n (- n 7))))

    (ly:make-pitch o n a)))

#(define ((shift amount) music)
  (let* ((es (ly:music-property music 'elements))
         (e (ly:music-property music 'element))
         (p (ly:music-property music 'pitch))
         (body (ly:music-property music 'body))
         (alts (ly:music-property music 'alternatives)))

    (if (pair? es)
        (ly:music-set-property!
         music 'elements
         (map (shift amount) es)))

    (if (ly:music? alts)
        (ly:music-set-property!
         music 'alternatives
         ((shift amount) alts)))

    (if (ly:music? body)
        (ly:music-set-property!
         music 'body
         ((shift amount)  body)))

    (if (ly:music? e)
        (ly:music-set-property!
         music 'element
         ((shift amount) e)))

    (if (ly:pitch? p)
        (begin
          (set! p ((shift-pitch amount) p))
          (ly:music-set-property! music 'pitch p)))

    music))



sega = \relative c' <<
  \context Voice=va {\stemUp e8^4 f e g^5 d^2 e}
  \context Voice=vb {\stemDown c4._2 b_1 }
>>
segb = \relative c'' <<
  \context Voice=va {\stemUp e4.^4 f^5 }
  \context Voice=vb {\stemDown c8_2 b c a d^4 c }
>>

sequence = {
  \sega
  \applyMusic #(shift 1) \sega
  \applyMusic #(shift 2) \sega
  \applyMusic #(shift 3) \sega
  \applyMusic #(shift 4) \sega
  \applyMusic #(shift 5) \sega
  \applyMusic #(shift 6) \sega
  \segb
  \applyMusic #(shift -1) \segb
  \applyMusic #(shift -2) \segb
  \applyMusic #(shift -3) \segb
  \applyMusic #(shift -4) \segb
  \applyMusic #(shift -5) \segb
  \applyMusic #(shift -6) \segb
  <<
    \context Voice=va {\stemUp e'2.}
    \context Voice=vb {\stemDown c'2.}
  >>
}

\score {
  \context Staff {
    \time 6/8
    \sequence
    \transpose c g \sequence
    \transpose c d \sequence
    \transpose c a \sequence
  }
}




reply via email to

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