dostroke = #(define-music-function (parser location chord length)
(ly:music? num
ber?)
        #{
                \chordmode { e,$length:5.8 }
        #}
)

------------------------------------------------------------

        I presume you can all see what I'm trying to achieve here.
However, I
can't get it to work, [...]

You cannot use the parameter "length" as a number because in something like
c4. , the 4. is not a number (because of the dot)
But, using the \makeRhythm  of this snippet :
   http://lsr.dsi.unimi.it/LSR/Item?id=390
and redefining the \transpose function,
you can have something like that :


%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\version "2.11.40"
\include "rhythm.ly "             %% see the snippet to build this file.

transposeAlt = #(define-music-function (parser location note music)
(ly:music? ly:music?)
(
   let* (
       (from (ly:make-pitch 0 0 0))
       (to (ly:music-property (car (ly:music-property note 'elements))
'pitch))
       (delta (ly:pitch-diff to from))
    )
    (ly:music-transpose music delta)
))

dostroke = #(define-music-function (parser location chord lengthStr )
(ly:music? string?)
#{
       \transposeAlt $chord \makeRhythm  \chordmode { c4:5.8 } $lengthStr
#}
)

                                %%%%%%%%%%%%%%%%%%%%%


\dostroke e' "2."

%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

Gilles.



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

Reply via email to