lilypond-user
[Top][All Lists]
Advanced

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

trying to create a function with different pitches and different rhythms


From: Stefan Thomas
Subject: trying to create a function with different pitches and different rhythms
Date: Sat, 23 Jun 2018 10:14:25 +0200

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' }





reply via email to

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