Lilypond function; add a rhythm to a note -


how can write lilypond function takes in note , outputs note rhythm? say: input: c' output: c'8 c'16 c'

in lilypond documentation can find example:

rhythm = #(define-music-function (parser location p) (ly:pitch?)    "make rhythm in mars (the planets) @ given pitch"   #{ \tuplet 3/2 { $p 8 $p $p } $p 4 $p $p 8 $p $p 4 #})  \new staff {   \time 5/4   \rhythm c'   \rhythm c''   \rhythm g } 

enter image description here

hopefully can adapted want! replace mars rhythm own. , please note space needed between variable $p , durations.


Comments

Popular posts from this blog

java - BeanIO write annotated class to fixedlength -

Using Java 8 lambdas/transformations to combine and flatten two Maps -

How to connect android app to App engine -