denemo-devel
[Top][All Lists]
Advanced

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

[Denemo-devel] Assembling a book of pieces from a set of Denemo scores


From: Richard Shann
Subject: [Denemo-devel] Assembling a book of pieces from a set of Denemo scores
Date: Mon, 01 Jul 2019 16:28:31 +0100

If you have a set of pieces saved as Denemo scores and want to create
full score and parts for them and put them all into a single pdf then
you may like to tinker with this script:

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8>

#!/bin/bash
find . -name "*.denemo" -exec gzip -f '{}' \;
mkdir DenemoPDFoutput
rm DenemoBook.pdf
(IFS=$'\n'; for f in *.denemo.gz ; do denemo -n -a 
"(d-SelectDefaultLayout)(d-ExportPDF 
\""`pwd`/DenemoPDFoutput/"$f-Ascore.pdf\")(d-MoveToMovementBeginning)(d-LilyPondForPart)(d-ExportPDF
 \""`pwd`/DenemoPDFoutput/"$f-Bpart.pdf\")" $f ; done )
(IFS=$'\n'; gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite 
-sOutputFile=DenemoBook.pdf DenemoPDFoutput/*.pdf)
rm -rf DenemoPDFoutput

8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8><8>

It creates the Default Score Layout and the Solo part (from the topmost
part) for all Denemo scores in the current directory and generates a
pdf DenemoBook.pdf which contains all those pdfs.

This version assumes a single solo part in the topmost staff. In case
anyone may want to adjust it for their own use the relevant bit to
change is the Scheme script which is run on all the Denemo scores (*)
Here I give a guide to that bit of Scheme:

;;; select the default layout - the full score
(d-SelectDefaultLayout) 

;;; exports that layout as PDF to a temporary directory DenemoPDFoutput
;;; the name is made from the file name with "-Ascore" appended
;;; where the A is just to force the alphabetical ordering
(d-ExportPDF \""`pwd`/DenemoPDFoutput/"$f-Ascore.pdf\") 

;;; create the score layout for the topmost part
(d-MoveToMovementBeginning)
(d-LilyPondForPart)

;;; export that to PDF using B to make it come after the full score
(d-ExportPDF \""`pwd`/DenemoPDFoutput/"$f-Bpart.pdf\")

the script then uses Ghostscript (gs must be in the path) to
concatenate all the PDFs and then deletes the temporary files.

Richard

(*)The scores are all compressed first to save having to deal with both
compressed and uncompressed scores in the script - Denemo is quite
happy to open compressed scores.




reply via email to

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