Class: IntermediateSong


Extended version of the Song class to build intermediate files.

new IntermediateSong (songPath, projectorPath, pianoPath, fileMonitor)

Name Type Description
songPath string

The path of the directory containing the song files or a path of a file inside the song folder (not nested in subfolders)

projectorPath string

Directory to store intermediate files for the projector app (*.svg, *.json).

pianoPath string

Directory to store intermediate files for the piano score (*.eps).

fileMonitor module:@bldr/songbook-intermediate-files~FileMonitor

A instance of the FileMonitor() class.


A instance of the FileMonitor class.


cleanIntermediateFiles ()

Delete all generated files of a song folder.

formatPianoTex ()string

Generate TeX markup for one song.

Type Description
string TeX markup for a single song.
{title} % title
{subtitle} % subtitle
{composer} % composer
{lyricist} % lyricist

formatPianoTeXEpsFile_ (index)string private

Format one image file of a piano score in the TeX format.

Name Type Description
index number

The index number of the array position

Type Description
string TeX markup for one EPS image file of a piano score.

generateIntermediateFiles (mode, force)

Wrapper method for all process methods of one song folder.

Name Type Default Description
mode string all

Generate all intermediate media files or only slide and piano files. Possible values: “all”, “slides” or “piano”

force boolean false

Force the regeneration of intermediate files.

generatePDF_ (source, destination) private

Generate form a given *.mscx file a PDF file.

Name Type Description
source string

Name of the *.mscx file without the extension.

destination string

Name of the PDF without the extension.

generatePiano_ ()array private

Generate from the MuseScore file “piano/piano.mscx” EPS files.

Type Description
array An array of EPS piano score filenames.

generateSlides_ (folder) private

Generate svg files in a 'slides' subfolder.

Name Type Description
folder string

A song folder.