Skip to main content

Add Lyrics

Add lyrics with this function similar to addNote.

builder.addLyrics(voiceId, lyricsLength, lyrics, lyricsOptions?);

Arguments:

voiceId

Voice id is same as for addNote. It can be 1, 2, 3 or 4.

lyricsLength

Lyrics length is same as noteLength, e.g. "1n", "2n", "2.", "4..", etc.

lyrics

This is the lyrics/syllable typeof string, or string[] to add multiple syllabes at once.

lyricsOptions

Lyrics options is an object.

{
// string alignment
align: "left" | "center" | "right",
// hyphen
// `-` (hyphen): a short line centered between this and next syllable.
// `---` (extender): a long line between this and next syllable.
hyphen: "-" | "---"
}

Examples

builder.addLyrics(1, "4n", "La");                      // Add syllable "La", quarter note length, verse 1.
builder.addLyrics(1, "4n", ["La", "la", "la", "la"]); // Add multiple syllables, each quarter note length, verse 1.
builder.addLyrics(2, "4n", "La", { align: "left" }); // Left align syllable.
builder.addLyrics(2, "4n", "La", { align: "center" }); // Center align syllable.
builder.addLyrics(2, "4n", "La", { align: "right" }); // Right align syllable.
builder.addLyrics(3, "4n", "La", { hyphen: "-" }); // Add hyphen.
builder.addLyrics(3, "4n", "La", { hyphen: "---" }); // Add extender.