The Mudcat Café TM
Thread #45197   Message #694180
Posted By: JohnInKansas
20-Apr-02 - 03:04 AM
Thread Name: Tech: Converting PDF Sheet Music
Subject: RE: Tech: Converting PDF Sheet Music
One thing to look at would be the simple file size problem.

I typically use an old music scoring program called "Rhapsody," which is (I think unfortunately) no longer available. It produces a "printable" score identified with a file extension .rhp. The .rhp file for a typical tune, melody line only, 16 measures, is between about 10K to 19K, with about 12K being "average." Unfortunately, printing the .rhp file requires that you have the Rhapsody program,

My S.O. frequently uses a current "simple" notation program called "PrintMusic," that produces a file with extension .mus. Typical .mus files for the same kind of tune run about 20K to 40K. Again, printing requires that you have the PrintMusic program.

Either of these programs, Rhapsody or PrintMusic, can save the tune as a midi (.mid) file, with a typical filesize of about 1K to 4K bytes.

The commonly used (at Mudcat) Noteworthy Composer produces a very basic notation, with a file size about twice as large as a MIDI file.

An unfortunate limitation of these programs is that you cannot "extract" just the part of the page that has music on it, or just a portion of the tune. When you print, you get a full page, in my case (US) an 8.5" x 11", "picture."

Printing individual .rhp or .mus (and probably .nwc) files "to file," using a PostScript printer driver, produces a PostScript "print file." The default file extension is usually .prn, but if you change the extension to .eps (or.ps) you should have a perfectly valid .eps file. The 12K typical .rhp file produces a 127K to 170K .eps file. You can "paste" an eps file into Word, but each "eps picture" wants to be a full page.

Anyone with a PostScript printer could "copy" the resulting .eps (or.ps) file to the printer to print the tune.

I have used the ghostscript/ghostview program to view single tunes and "read" the dimensions of the area containing music. You can also copy the eps to a PostScript printer, print the sheet, and measure to get these dimensions. The dimensions needed are from the bottom edge of the sheet to the lowest point of the music (yb), from the bottom edge of the sheet to the highest point in the music (yt), from the left edge of the sheet to the leftmost point (xl) and from the left edge to the rightmost point (xr). These measurements must be expressed in "points," so if you don't have one of those fairly rare "printer's rules" that has a "point" scale, measure in inches and multiply by 72.

The .eps file is plain text, so you can open it in Word (most are too large for notepad) and find the line near the top of the file (usually the third line) that says "%%BoundingBox: 72 72 518 720 " The four numbers shown here indicate an 8.5 x 11 page with 1 inch margins. Change only the four numbers to the xl yb xr yt values measured (in that order). A typical 4 staff melody line score might be something like "%%BoundingBox: 19 473 594 774 ". Save as a text only file, retaining the .eps extension. You now have an eps file that prints only the music part of the page. (Note that changing those four numbers does not change the size of the eps file significantly.)

If you paste several of these into a Word document, you get a Word .doc file that can be printed (from Word), but since the "pictures" can only be printed by a PostScript capable printer, your document now requires a PostScript printer to be successfully printed.

The "Airs" section of a recent Word document has a file size of 2,235K (2.2MB), and contains 33 tunes on 20 pages.

To "distill" the above "Airs" document to .pdf requires that it (the Word doc) be printed to file with a PostScript driver, producing an eps file of about 5,813KB (5.8MB). Word shows it, if opened as text, as a 3,033 page "document."

Adobe Acrobat Distiller converts this "print file aliased as eps" to a 453 KB .pdf file. The pdf document is 20 pages, 33 tunes, that anyone should be able to to display and to print (using the free Acrobat Reader) on any (graphics capable) printer.

A typical single melody-line-only tune of 16 to 20 measures is:
About 1K to 4K as a MIDI.
About 4K to 15K as a Noteworthy nwc.
About 10K to 40K (or more) in a "sophisticated" notation program file.
About 120K to 300K as an eps or ps file.
About 20K as a pdf file.

Only the pdf file can be printed by any user with the (free) Acrobat Reader.

Apologies for the length. Hopefully it will be helpful.

John