Greetings,
Thank you, Kieren and Simon. When I created a minimal sample, I used a poor
example and the two easy solutions you suggested would be perfect.
I REALLY want to be able to re-use a melody while selectively altering parts
of it. Here are two more possibilities --
turning a melody in a minor key into a major key.
\version "2.24.3"
melodyViolin = { c'2 \downbow g'2 \upbow es'2. d'4 | c' es' d' c' | b d'
g2 }
melodyTrumpet = {\melodyViolin} %remove bowings
%instead of repeating the melody I would like this code to remove the
bowings
#(define removeBowing (map ly:music-deep-copy
(list melodyViolin melodyViolin )))
#(define twice
(make-sequential-music removeBowing))
{\clef alto \melodyViolin}
{\transpose bes, c {\clef treble \twice}}
\version "2.24.3"
melodyMinor = {c'2 g'2 es'2. d'4 | c' es' d' c' | b d' g2 }
{\melodyMinor }
% coding magic here to replace es with e
%something like -> melodyMajorAltered=(string-replace "melodyMinor" "es"
"e")
melodyMajor = {\melodyMinor} %after alterations
{\melodyMajor}
Be content; it is your birthright.
Peter