Including Musescore into a larger book

• Aug 18, 2021 - 01:51

I have undertaken a project to translate and modernize an older manuscript.
Each section has text and music.

I was wondering if anyone has done this sort of thing and can clue me in on how to format the sections and then how to bring them together in book form.

I know how to insert text and I know some Latex. Just looking for best practices.

Thank you.


Comments

It’s probably best if you let MuseScore generate entire pages, then embed them into the pdflatex output by either:

  • generate pages, say, 1-10, 13-15 and 17-18 in latex with PDF output
  • generate pages 11-12 and 16 from two (distinct) MuseScore files, setting their first page number appropriately
  • ensure header/footer are consistent between the two
  • mix the pages in the output using some PDF utility like pdftk

Or:

  • generate pages 11-12 and 16 from two (distinct) MuseScore files, setting their first page number appropriately
  • ensure MuseScore header/footer are empty
  • embed those pages as full pages, perhaps as “background”, on the corresponding pages in the .tex document, and make sure they are clear (just \newpage) there except for maybe header/footer
    • generate the entire document from pdflatex

The second method absolutely requires pdflatex, the first can also work with e.g. latex+dvips+pstopdf13. The reason for this is that the second method uses pdflatex-specific commands to basically embed objects from external PDFs.

A third method would be to also use individual MuseScore files for your musical snippets, but to set the page size in MuseScore to smaller than a full page; basically only large enough to produce the snippet. Then, again, export to PDF (as that’s the sanest form you can read in latex) and use \includegraphics in the places where you want to embed them, with a \DeclareGraphicsExtensions{.pdf,.png,.jpg}% in the preamble.

It's possible to use more ordinary graphics formats with LaTex, but quite awkward to get the resolutions correct. Not sure why, maybe I just don't really understand, but I did manage to use that approach successfully in producing the original "Mastering MuseScore" manuscript. It was painful enough that I won't go there again, though. If I do another full book, it will be with LibreOffice so I can simply paste graphics in (using the "copy with link to score" feature of the image capture tool in MuseScore that I added just for such an eventuality).

In reply to by Marc Sabatella

The other formats are not suitable though:

  • SVG is not supported by Tₑχ/LᴬTᴇΧ and has to be converted to one of the other two vector formats (PDF or EPS)
  • EPS has different issues depending on whether dvi output latex or pdflatex are used and needs an extra program to fix them up, so it’s easier to use PDF as graphics (as opposed to page) format; man purifyeps for details
  • PNG is a bitmap format; the output of Tₑχ/LᴬTᴇΧ is otherwise an infinite-resolution scalable vector, so this is an inacceptable loss of quality (even if you use 1200 dpi in the export so it would usually print well: any scaling done on the Tₑχ/LᴬTᴇΧ side would cause artefacts because of rounding twice)
  • JPG is a lossy bitmap format with visible compression artefacts and (in addition to the problems PNG has) absolutely unsuitable for anything else than photos (of landscape, cats, …) or movie stills; in contrast to the other formats, there is also no facility for transparency, which may or may not be important

While I don’t have a public project handy that uses this yet, I’ve done quite some thinking this over some time ago ☻

In reply to by mirabilos

I would say "unacceptable loss of quality" is in the eyes of the beholder. Given that a very large number of the images in my book are actually screenshots so I can show the UI and not just the music, and that those obviously have to be done as bitmaps, having those images that are just music be of higher quality was not a concern for me. Also consider that millions of pages of textbooks have similarly been printed using bitmap images for all sorts of examples - music is almost unique in that world in being representable in vector form at all. Also, note that in the end, the printer actually used is typically only dealing with around 180 DPI - and it seems Amazon changes their vendors pretty regularly as there is noticeable difference in print quality for text as well as images from one print run to the next.

So again, it's true that in theory, a vector format like PDF will be preferable to a bitmap format like PNG, all else equal - but all else is never equal, and the in any event, the difference may or may not end up being noticeable in the final result. Something to consider for sure, but I wouldn't rule it in practice out just because in theory it doesn't work as well.

IMHO nowadays I would use for such a project a DTP application like scribus.

Long time ago I used LaTeX for text preparation and MusiXTeX for music notation - in times where such WYSIWYG applications were not available. But meanwhile it's much easier for me to use MuseScore as music notation application, exporting the scores as pdf, svg, png... and importing the into Scribus. There you can create individual templates, profiles, preparing it as RGB or CMYK (...) for a professional print.
So for me it's more comfortable in this way meanwhile and I don't see any disadvantage to use it compared to LaTeX.

I use the method suggested by mirabilos. I export the book text as PDF (with pages left blank at appropriate spots so that the numbering works out). Then I use a PDF editor to replace the blank pages with those exported from MuseScore. One does have to take care that any headers and footers match.

So I went about trying to do this today and realized that I had not understood the comments. I am going to have around 50 musescore pdfs with text and music. There are a few pages of text at the beginning and then the pdfs.

I want a master document that will import the pdfs when the master document is 'rendered'. But I want to be able to update the musescore files if there are any errata etc. I do not want to insert pdfs individually into the master document each time I want to print a copy. Is there a way to do this using any software?

In reply to by SRaybourne

I recommend using Scribus. Although it is a bit difficult to use the styles and get used to the software, it really provides a lot of convenience.
As long as you export the PDFs with the same name and into a specific folder, the content in Scribus also changes automatically.

PS: It is a great convenience to select any area of the PDF (for example, just a measure in a staff) and show only that part. A sample page attached.

Attachment Size
sss-01.png 135.27 KB
# 0 Ritm Gitar - c8b-p10.pdf 180.35 KB

In reply to by SRaybourne

If you have skills with LaTeX, try the pdfpages or graphicx packages (see https://www.sascha-frank.com/Faq/include_pdf.html). Based on what others have written, Scribus sounds like it may be a good option; but it is not an easy learning curve.

Just to clarify: under the system I use, there is no need to insert pdfs individually into the master document each time you want to print a copy. Here is my workflow.
1. Edit text in word processor and export as PDF.
2. Edit musical examples and export from MuseScore as PDF.
3. Open new document in PDF editor (I use PDF-XChange, but there are many available). Import the text (which has blank pages where the musical examples go).
4. Replace, let's say, page 5 (blank) with "music_example_1.pdf". (I don't know how much experience you've had with PDF editors; they usually work on the principle of adding/deleting/replacing entire pages). Keep going as needed. Save as a new file -- I'll call it "master_combined.pdf". You can open/view/print this file whenever you like.

To update a musical example, open the master file in PDF editor and tell it to replace page 5 with "music_example_1_update" then save.

If your text and music examples are under heavy editing, you'd probably be best off finding a solution that would automatically incorporate the various files. I tend to wait until things are very close to final before putting everything together, which minimizes updates. Hope this helps.

Do you still have an unanswered question? Please log in first to post your question.