Create new document builder instance.
Optionaloptions: DocumentOptionsAdd annotation with label text to current measure.
Annotation kind.
Label text.
Optionaloptions: AnnotationOptionsAnnotation options.
Add any annotation kind to current measure.
Annotation kind (e.g. "pp").
Optionaloptions: AnnotationOptionsAnnotation options.
Catch all overload for deprecated stuff. Wil be removed in future release.
// Deprecated:
addAnnotation(group: AnnotationGroup, kind: string, options?: AnnotationOptions): DocumentBuilder;
// Use instead:
addAnnotation(kind: string, { group: AnnotationGroup }): DocumentBuilder;
// Deprecated:
addAnnotation("ending", ...endingPassages: number[]): DocumentBuilder;
// Use instead:
addAnnotation("ending", { endingPassages: number | number[] }): DocumentBuilder;
// Deprecated:
addAnnotation("endRepeat", repeatCount?: number): DocumentBuilder;
// Use instead:
addAnnotation("endRepeat", { repeatCount: number }): DocumentBuilder;
Add annotation with label text to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind.
Label text.
Optionaloptions: AnnotationOptionsAnnotation options.
Add any annotation kind to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind (e.g. "pp").
Optionaloptions: AnnotationOptionsAnnotation options.
Catch all overload for deprecated stuff. Wil be removed in future release.
// Deprecated:
addAnnotation(staffTargets, group: AnnotationGroup, kind: string, options?: AnnotationOptions): DocumentBuilder;
// Use instead:
addAnnotation(staffTargets, kind: string, { group: AnnotationGroup }): DocumentBuilder;
// Deprecated:
addAnnotation(staffTargets, "ending", ...endingPassages: number[]): DocumentBuilder;
// Use instead:
addAnnotation(staffTargets, "ending", { endingPassages: number | number[] }): DocumentBuilder;
// Deprecated:
addAnnotation(staffTargets, "endRepeat", repeatCount?: number): DocumentBuilder;
// Use instead:
addAnnotation(staffTargets, "endRepeat", { repeatCount: number }): DocumentBuilder;
Add chord to current measure.
Voice id to add chord to.
Array of notes, each instance of Theory.Note or string (e.g. "D4").
Theory.Note length (e.g. "4n").
OptionalnoteOptions: NoteOptionsTheory.Note options.
Add tie starting from last added note/chord.
T.Connective type ("tie" or T.Connective.Tie).
OptionaltieSpan: number | TieTypeValueHow many notes across this tie spans.
OptionalnotAnchor: NoteAnchorValueAnchor point for note and this tie.
Add slur starting from last added note/chord.
T.Connective type ("slur" or T.Connective.Slur).
OptionalslurSpan: numberHow many notes across this slur spans.
OptionalnotAnchor: NoteAnchorValueAnchor point for note and this slur.
Add slide starting from last added note/chord.
T.Connective type ("slide" or T.Connective.Slide).
OptionalnotAnchor: NoteAnchorValueAnchor point for note and this slide.
Add extension line to previously added annotation or label element.
// Example
addExtension(ext => ext.notes("1n", 2)) // length is 2 whole notes
addExtension(ext => ext.measures(3).hide()) // length is 3 measures, hidden
addExtension(ext => ext.measures(1).notes("8n")) // length is 1 measure + 1 eigth note
addExtension(ext => ext.infinity()) // length is as long as possible
OptionalextensionBuilder: (ext: ExtensionBuilder) => voidExtension builder function used to build exstension.
Add fermata to current measure.
Fermata position: "atNote" (default) or "atMeasureEnd".
Add fermata to current measure.
Single or multiple staff/tab/group identifiers.
Fermata position: "atNote" (default) or "atMeasureEnd".
Add label text to column of last added note/chord/rest in current measure.
T.Label type: "chord" or "note".
label text.
Add label text to column of last added note/chord/rest in current measure to given staff/tab/group.
Single or multiple staff/tab/group identifiers.
T.Label type "chord" or "note".
label text.
Add lyrics to current measure.
Verse number (e.g. 1).
Lyrics text (empty space if omitted), single value or array.
Lyrics text length (e.g. "2n").
OptionallyricsOptions: LyricsOptionsLyrics options.
Add lyrics to current measure to given staff/tab/group.
Single or multiple staff/tab/group identifiers.
Verse number (e.g. 1).
Lyrics text (empty space if omitted), single value or array.
Lyrics text length (e.g. "2n").
OptionallyricsOptions: LyricsOptionsLyrics options.
Add new measure.
OptionalmeasureOptions: MeasureOptionsMeasure options.
Add navigation to current measure.
Navigation annotation to add.
Add end repeat navigation to current measure.
Navigation annotation to add.
Play count for the repeated section.
Add ending navigation to current measure.
Navigation annotation to add.
Passages that this ending is played.
Add navigation to current measure to given staff/tab/group.
Single or multiple staff/tab/group identifiers.
Navigation annotation to add.
Add end repeat navigation to current measure to given staff/tab/group.
Single or multiple staff/tab/group identifiers.
Navigation annotation to add.
Play count for the repeated section.
Add ending navigation to current measure to given staff/tab/group.
Single or multiple staff/tab/group identifiers.
Navigation annotation to add.
Passages that this ending is played.
Add note to current measure.
Voice id to add note to.
Instance of Theory.Note or string, single value (e.g. "C4") or array (e.g. ["C4", "E4", "G4"]).
Theory.Note length (e.g. "4n").
OptionalnoteOptions: NoteOptionsTheory.Note options.
Add rest to current measure.
Voice id to add rest to.
Rest length (e.g. "4n").
OptionalrestOptions: RestOptionsRest options.
Add notes of given scale in ascending order.
Scale.
Scale starts from note >= bottom note.
Number of octaves to add.
Add staff group.
Name of staff group.
Single or multiple staff/tab/group identifiers. Single value or array.
Vertical position, are elements added above, below or both.
Usage:
addTuplet(0, Theory.Tuplet.Triplet, notes => {
notes.addNote("G3", Theory.NoteLength.Eighth);
notes.addNote("B3", Theory.NoteLength.Eighth);
notes.addNote("D4", Theory.NoteLength.Eighth);
});
Voice id to add tuplet to.
You can also use Theory.Tuplet presets (e.g. Theory.Tuplet.Triplet).
Tuplet builder function to build tuplet.
End current score row. Next measure will start new row.
Add section end. Adds certain bar line at the end of measure.
Add song end. Adds certain bar line at the end of measure.
Fill current measure with rests.
Voice id to add rests to. Single value, array or all if omitted.
Add and repeat builder section.
Repeat count.
Repeat creator function.
Usage examples:
// throw (default)
builder.setErrorHandler((e) => { throw e; });
// log
builder.setErrorHandler((e) => { console.error("Doc build failed:", e); });
// log and throw
builder.setErrorHandler((e) => { console.error("Doc build failed:", e); throw e; });
// Silent
builder.setErrorHandler((e) => { });
Error handler function.
Set header texts.
Optionaltitle: stringTitle of this docmument/musical piece.
Optionalcomposer: stringComposer of this document/musical piece.
Optionalarranger: stringArranger of this document/musical piece.
Set key signature for current measure and forward.
Tonic note (e.g. "C").
Scale type (e.g. string "Major" or ScaleType.Major).
Set key signature for current measure and forward.
KeySignature object instance.
Set key signature for current measure and forward.
Key signature string (e.g. "C Major").
Set key signature for current measure and forward.
Scale object instance.
Automatically limit number of measures per score row.
Number of measures per row. Must be integer >=1 or Infinity.
Use staff preset values to set score confguration. This call will request new score row.
Staff preset (e.g. "treble").
Use staff preset values to set score confguration. This call will request new score row.
Score configuration (e.g. { type: "staff", clef: "G", isOctavewDown: true }).
Set tempo.
Tempo beats per minute.
Set tempo.
Tempo beats per minute.
Length of one beat.
Set common or cut time signature for current measure and forward.
"C" or "C|".
Set time signature for current measure and forward.
TimeSignature object instance.
Set time signature for current measure and forward.
TimeSignatures enum value or string (e.g. "3/4").
OptionalbeamGrouping: BeamGroupingValueBeam grouping (e.g. "3-2" for time signature "5/8").
Set time signature for current measure and forward.
Beat count of time signature (e.g. 3 in "3/4").
Beat size of time signature (e.g. 4 in "3/4").
OptionalbeamGrouping: BeamGroupingValueBeam grouping (e.g. "3-2" for time signature "5/8").
Document builder class.