PDF (Music Book) Assembly

For those interested, a video with Indesign;

that corresponds to @benwiggy’s Affinity Publisher procedure.

1 Like

I ‘dabbled’ in Python this evening and got a working embryo for LaTeX output using CSV files to write TOC and mount PDF files. I will test some more during the weekend. As normal with such solutions, they are to some degree focused on a special ‘m.o.’ so they might not always be ideal for some users.
Possibly, the same can be done with XML in InDesign. It requires some research. I don’t have Adobe FrameMaker anymore, but their internal language, MIF, is very easy to program.

I would be very interested in this! (XML to ID I mean).

Yes, it’s something that’s been on my mind for quite some time. I will keep the forum posted on any success.

It did not seem straightforward (some forums even said it was ‘impossible’ to mount multiple PDFs, but I doubt it), but I found a way to use the Book function. You might already be familiar with it, but I write it down ‘just in case’.

  1. For each PDF, you create an ID file
  2. In the file, mount the PDF using the Java Script. It goes fairly quickly.
  3. On the first page of each ID file, add a layer and type the entry as it is needed in the TOC, e.g. "Johann Sebastian Bach — Toccata and fugue in D-minor, BWV 525”. Use a dedicated paragraph style for this. Place the text frame at the top of the page. The formatting is irrelevant as long as you can read it. The text entry can either be C/P from Dorico or CSV export and parsing/extraction using Python, like my LaTeX script. The less typed, the better.
  4. Add the ID files in requested order in the Book file
  5. For each ID file, open it and set the page numbering specs to “Continue” and define whether or not that particular piece should start on the RH or LH page
  6. In the book file, add a new blank document and place it where the TOC should go in the complete book.
  7. Open the TOC file and add a TOC. Make sure to specify that the dedicated format is used, as well as “Include text in hidden layers” so that the text strings are used and hidden.
  8. Update the TOC if needed.
    This will dynamically fetch the text strings from the pieces (ID files).

Make sure to place the mounted music in a separate layer if you, for some reason, want to remove the mounted pages (and don’t want to do it “300 times” for each page), simply delete the layer and insert a new layer and re-mount the music.

As the number of files grows (≥ the number of pieces), it’s important to have a strict regime of synchronized formats. This is a bit ‘tricky’ and unclear, but it is done by selecting the master document in the book file and selecting synchronized. (No other file in the book file needs to be selected, the book is treated as a whole)

Note: Apply proper paragraph format to the TOC rows as they initially inherit the format from the individual document
Also, make use of the “Use book document” for the TOC settings.

Finally, any token from the hidden text strings is included, even so tabs etc., which makes it possible to autogenerate non-traditional TOCs that more resemble a multicolumn table, often found in chorale collections, e.g.

Mozart Some title something more page number
Bach Some title something more page number

etc.

It is possible that some extensive XML-solution could do this in “one go”, I know of catalog systems that produces close to perfect ID files via database but currently I’m not sure how it is made. It could be DITA etc. which is on another level that luckily music publishing does not have to deal with…