Class: PianoScore

@bldr/songbook-intermediate-files~PianoScore

The piano score.

Generate the TeX file for the piano version of the songbook. The page orientation of the score is in the landscape format. Two EPS files exported from MuseScore fit on one page. To avoid page breaks within a song a piano accompaniment must not have more than four EPS files.

new PianoScore (library, groupAlphabetically, pageTurnOptimized)

Name Type Default Description
library module:@bldr/songbook-intermediate-files~Library

An instance of the class “Library()”

groupAlphabetically boolean true
pageTurnOptimized boolean true

Members

groupAlphabetically boolean

An instance of the class “Library()”.

pageTurnOptimized boolean

texFile string

A temporary file path where the content of the TeX file gets stored.

Methods

module:@bldr/songbook-intermediate-files~PianoScore.buildSongList (songs)string static

Build the TeX markup of an array of song objects

Name Type Description
songs module:@bldr/songbook-intermediate-files~songs

An array of song objects.

Returns:
Type Description
string

module:@bldr/songbook-intermediate-files~PianoScore.selectSongs (countTree, songs, pageCount)module:@bldr/songbook-intermediate-files~songs static

Fill a certain number of pages with piano score files.

Name Type Description
countTree module:@bldr/songbook-intermediate-files~PianoFilesCountTree

Piano scores grouped by page number.

songs module:@bldr/songbook-intermediate-files~songs

An array of song objects.

pageCount number

Number of pages to group together.

Returns:
Type Description
module:@bldr/songbook-intermediate-files~songs An array of song objects, which fit in a given page number

module:@bldr/songbook-intermediate-files~PianoScore.texCmd (command, value)string static

Generate TeX markup. Generate a TeX command prefixed with \tmp.

Name Type Description
command string
value string
Returns:
Type Description
string A TeX markup, for example: \tmpcommand{value}\n

build (groupAlphabetically, pageTurnOptimized)string

Build the TeX markup for all songs.

Name Type Description
groupAlphabetically boolean
pageTurnOptimized boolean
Returns:
Type Description
string

compile ()

Compile the TeX file using lualatex and open the compiled pdf.

read_ (The)string private

Read the content of a text file.

Name Type Description
The filename

name of the text (TeX) file inside this package

Returns:
Type Description
string

spawnTex_ () private