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

2018-03-02 Thread Thomas Morley-2
Paolo Prete wrote > 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#}) > { 

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

2018-03-02 Thread Paolo Prete
Meanwhile, I found a solution for my question, for anyone who could be interested: createTuplet = #(define-music-function (parser location notes) (ly:music?)(let  ((noteCount (length (extract-typed-music notes '(note-event event-chord rest-event skip-event  )   #{   \times #(cons 2

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

2018-03-02 Thread Paolo Prete
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'}}