lilypond-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to count the number of notes in a .ly file?


From: David Kastrup
Subject: Re: How to count the number of notes in a .ly file?
Date: Wed, 11 Dec 2013 15:31:44 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux)

David Kastrup <address@hidden> writes:

> "Jan Rosseel" <address@hidden> writes:
>
>> That's a good suggestion, but it fails on my scores: 
>>
>> Interpreting music...C:/Program Files
>> (x86)/LilyPond/usr/share/lilypond/current/ly/event-listener.ly:145:35:
>> In procedure ly:duration-length in expression (ly:duration-length
>> (ly:event-property event #)):
>> C:/Program Files
>> (x86)/LilyPond/usr/share/lilypond/current/ly/event-listener.ly:145:35:
>> Wrong type argument in position 1 (expecting Duration): #f
>>
>> I don't have time now to figure out what is causing this. Neither can I
>> risk making changes to the scores at such a short time before our launch
>> concert. Ah well. No note count in my speech then. Would have been nice
>> to be able to know how many notes we wrote into LP for the concert. 
>
> It helps not to use personal replies: I'm often trying to juggle so many
> things at once that stuff will just slip through my attention.
>
> Try putting the following at the top of your score:
>
>
> #(set! toplevel-music-functions
>   (append toplevel-music-functions
>    (list
>     (lambda (music parser)
>      (format (current-error-port)
>       "\n~a notes encountered.\n"
>       (fold-some-music
>        (lambda (x) (music-is-of-type? x 'note-event))
>        (lambda (x n) (1+ n))
>        0
>        music))
>      music))))
>
> \score { { c d e f } }

Of course omitting the \score line, sorry.

> I count notes in chords separately.

-- 
David Kastrup



reply via email to

[Prev in Thread] Current Thread [Next in Thread]