[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Denemo-devel] Creating a catalog of all the scores you have written
From: |
Richard Shann |
Subject: |
Re: [Denemo-devel] Creating a catalog of all the scores you have written. |
Date: |
Sat, 29 Dec 2018 17:05:12 +0000 |
On Thu, 2018-12-06 at 09:59 +0000, Richard Shann wrote:
> Recently I was asked for pieces involving a certain combination of
> instruments. I knew I had some, but as I have over a thousand Denemo
> scores I realized I needed something more than just my memory to fish
> them out.
> So I wrote a script that goes through all the folders below a
> starting
> folder opening the Denemo scores it finds and extracting title,
> composer, score comment, instrument list and an incipit - that is the
> opening music. When this is finished (it is very slow of course) it
> creates a Denemo Score which typesets as an index of all the music it
> found.
>
> This script can now be run from the File->Indexing menu
I've done more work on this and there is now a command to create an
index of your scores which can be customized to select scores with
specific features determined by executing a Scheme script you provide;
here is some of the documentation:
With Create Conditional Index you can create more complex conditions to
determine which scores should be included in the index, and in addition
you can create a comment for the index entry based on the score's
content. A convenience function DenemoIndexCommentDisplay is provided
to set the comment you wish to include in the index entry for a given
score. Here is an example which computes the durations of all the
movements in the score and prints that as the comment:
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define total 0)
(set! total (ForAllMovementsExecute* (lambda () (let ((tot '()))
(define (off)
(define time (d-GetMidiOffTime))
(if time time 0))
(d-RecreateTimebase)
(d-MoveToEnd)
(off)))))
(set! total (round (apply + total)))
(DenemoIndexCommentDisplay (string-append
" Duration is: " (number->string (inexact->exact (floor-quotient total
60))) " m. "
(number->string (inexact->exact (floor-remainder total 60))) " s."))
#t
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This code is not nicely formatted in the Denemo Manual as I haven't
managed to come to grips with Lyx which generates it.
Richard