Sorry. Very late answer Here is a scheme way to proceed. (see attached file).
%% For version 2.18 change the first line by :
%% makeExercice = #(define-music-function (parser location p0 p1 p2 p3
highest-pitch lowest-pitch)
makeExercice = #(define-music-function (p0 p1 p2 p3 highest-pitch lowest-pitch)
(ly:pitch? ly:pitch? ly:pitch? ly:pitch? ly:pitch?
ly:pitch?)
"p0 : ton pitch.
p1,p2,p3 : pitches of the first 3 notes of the chords
The last 2 parameters : the pitch range"
(let ((octave 1))
(let loop ((p1 p1)
(p2 p2)
(p3 p3)
(l '()))
(let ((p (ly:pitch-transpose p1 (ly:make-pitch octave 0 0))))
(if (= octave 1) ; go up
(begin
(if (not (ly:pitch<? p highest-pitch)) ; the top note ?
(begin
(set! octave -1)
(loop p p3 p2
(cons p3 (cons p2 (cons p1 l))))) ; don't add p
(loop p2 p3 p
(cons p (cons p3 (cons p2 (cons p1 l)))))))
(begin ; go down
(if (ly:pitch<? p lowest-pitch) ; we stop when the lowest-ptch is
reached
(make-sequential-music (append
(cons (make-music 'NoteEvent
'articulations (list (make-music 'TieEvent)
; add here your markup
)
'duration (ly:make-duration 2) ; c4
'pitch p0)
(cons (make-music 'NoteEvent
'duration (ly:make-duration 4) ; c16
'pitch p0)
(map (lambda(p)(make-music 'NoteEvent 'duration
(ly:make-duration 4)
'pitch p))
(reverse l))))
(list (make-music 'NoteEvent
'duration (ly:make-duration 2) ; c4
'pitch p0))))
(loop p2 p3 p
(cons p (cons p3 (cons p2 (cons p1 l))))))))))))
\makeExercice c' e g c' e''' e
\makeExercice a e a c' e''' e
\makeExercice g' g b d' g''' g
\makeExercice e' e g b e''' e
artis = \relative c' {
\key c \major
\time 4/4
s4
\( \slurUp s16 (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.) \)
\slurUp s16 \( (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.) \)
\slurUp s \( (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.) \)
\slurUp s \( (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.)
\slurUp s (s-.) \slurDown s^. (s^.) \)
s4 \bar "|." %\break
}
\new Voice << \artis \makeExercice c' e g c' e''' e >>
foo.pdf
Description: Adobe PDF document
_______________________________________________ lilypond-user mailing list [email protected] https://lists.gnu.org/mailman/listinfo/lilypond-user
