Is the above code something flexible
enough that it could work with the first of those
being something other than c?
(e.g., \transpose f g \notes)
Just change
   (ly:make-pitch -1 0 0)     (<pitch c>)
by
    (ly:make-pitch -1 3 0)     (<pitch f>)
( 0 = c, 1 = d,  etc ...)

If you do want 2 parameters, proceed as for one (copy/past) changing only the names.

%%%%%%%%%%%%%%%%%
firstNotes = \relative c' { c4 d e f }

first = #(define-music-function (parser location root trans)(ly:music? ly:music?)
(let* (
   (trans-note (car (ly:music-property trans 'elements)))
   (trans-pitch (ly:music-property trans-note 'pitch))
   (root-note (car (ly:music-property root 'elements)))
   (root-pitch (ly:music-property root-note 'pitch))
   (delta-pitch (ly:pitch-diff trans-pitch root-pitch)))
(ly:music-transpose (ly:music-deep-copy firstNotes) delta-pitch)
))

\score {<<
\new Staff  \firstNotes
 \new Staff  \first c d
 \new Staff  \first d fis
 \new Staff  \first e a
 >>
}

%%%%%%%%%%%%%%%%%%
Gilles



_______________________________________________
lilypond-user mailing list
lilypond-user@gnu.org
http://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to