lilypond-user
[Top][All Lists]
Advanced

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

Re: Is there a better way of automating pitch changes of repeated phrase


From: Gilles THIBAULT
Subject: Re: Is there a better way of automating pitch changes of repeated phrases
Date: Thu, 30 Apr 2009 00:33:35 +0200


What I am forced to do is set a different transposition command after each
variable. I get the result, but wondered if there a more elegant manner.

I don't know if it is a more elegant solution but here is a quick solution if you have a lot of practice exercices to do.


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
doPract = #(define-music-function (parser location music notes skipmusic) (ly:music? ly:music? ly:music?)
(let (
 (pitch-list (list))
 (final-list (list )))
(music-filter
(lambda (evt);;%% build of pitch-list
 (let ((pitch (ly:music-property evt 'pitch)))
  (if (ly:pitch? pitch)
   (set! pitch-list (append
     pitch-list
     (list pitch))))
  #t ))
notes)

(while (not (null? pitch-list)) ;;%% build of final-list
(set! final-list (append
  final-list
  (list
   (ly:music-transpose
     (ly:music-deep-copy music)
     (car pitch-list)))))
(set! pitch-list (cdr pitch-list)))

(make-music 'SimultaneousMusic 'elements (list
   (make-music 'SequentialMusic 'elements  final-list)
   skipmusic))

))
       %%%% here is your job
PractOne = {g'( c') g'( c'')}
PitchesOne = { c' b bes a aes }
skipmusicOne = { s1-1 s1-2 \slurDown s1-1 \breathe }

\new Voice {
    \doPract \PractOne \PitchesOne \skipmusicOne
    %% \doPract \PractTwo \PitchesTwo \skipmusicTwo
}

%%%%%%%%%%%%%%

Gilles





reply via email to

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