Dear community,
I want to create a function, which adds automatically a crescendo from ppp
to pp to two tied pitches with different durations.
What  I dont understand:
I can create a function with the same pitch and different durations, I can
also create a function with diferent pitches and same durations, but if
both are choosen freely, I can't do it. Can someon give me a hint, whats
wrong with the code?

\version "2.18.2"

\layout {  \context { \Voice \override Hairpin.minimum-length = #10 }  }

%different durations, different  pitches, this doesn't work, why?
fadeIn = #(define-music-function (parser location PITCH durA durB)
(ly:pitch?  ly:duration? ly:duration?)
             #{
                 $PITCH  $durA  \<\ppp ~  $PITCH $durB \pp
               #})
\new Staff { \fadeIn c' 4 2. }

%different durations, same pitch, works fine
 playC = #(define-music-function (parser location durA durB) (ly:duration?
ly:duration?)
               #{
                 c'  $durA  \<\ppp ~ c' $durB \pp
               #})
               \new Staff  { \playC  2 2  \playC 4 2. }

%different pitches, same durations, works also fine

 playsameRhDiffPitch = #(define-music-function (parser location PITCH )
(ly:pitch?)
               #{
                 $PITCH 4 \<\ppp ~  $PITCH 2. \pp  #} )
\new Staff { \playsameRhDiffPitch c'  \playsameRhDiffPitch g' }
_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to