# Obtain the number of notes and rests from "ly:music?" parameter passed to a function

Hello,
in the snippet below how can I replace "4" (in the denominator of "\times")
with the number of notes+rests (including "s") in $notes ? Thanks  %%%%%%%% createTuplet = #(define-music-function (parser location notes) (ly:music?)#{ \times 2/4$notes#})
{  \createTuplet {c' e' r g'}}

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