[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re:How to count the number of notes in a .ly file? (David Kastrup)
From: |
Jan Rosseel |
Subject: |
Re:How to count the number of notes in a .ly file? (David Kastrup) |
Date: |
Wed, 11 Dec 2013 19:44:44 +0100 |
(Sorry for the repost - I promise I will not reply anymore from the
digest)
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.
>
> 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))))
This worked very nicely - thank you!
I checked the result against my part (trombone 3) In the 3rd
pianoconcerto from Rachmaninoff, and I get the following result:
Rach3-1: 0
Rach3-2: 9
Rach3-3: 185
Which is correct... The effect of this is visualized here:
http://www.youtube.com/watch?feature=player_embedded&v=6dI-S77-jIY
(Of course that's compressed in 4 minutes - the whole concerto lasts
around 40 minutes)
I've also learned that we entered 130K notes in LP for the SCORA launch
concert , of which 30K alone are for the piano part for Rach3. There's
also close to 700 staff up/down transitions in that score.
Rachmaninoff goes in public domain on January 1st. Maybe I should clean
up the sources a bit and put them on mutopia. There's a discussion here
on having examples of what LilyPond can do. Well, that's an example.
- Re:How to count the number of notes in a .ly file? (David Kastrup),
Jan Rosseel <=