"Jan Rosseel" <[email protected]> writes:

> Subject line says it about all. How can I count the number of notes
> present in a .ly file? Or the number of notes in a music expression? 

Number of notes in a music expression would be something like

#(length (extract-typed-music music 'note-event))

If you want to count rests, skips and similar stuff like notes, write
rhythmic-event above.  If a chord should only count once, write
#(length (extract-typed-music '(note-event event-chord)))
in order to stop the extraction at chord level.

> I assume somebody made some (python) script to do this, but I can't
> bring it to the surface with my googling skills... 

That really is a use case where LilyPond's Scheme interpreter makes
things easier than an external script.

-- 
David Kastrup

_______________________________________________
lilypond-user mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/lilypond-user

Reply via email to