Create new document builder instance.
Optionaloptions: DocumentOptionsAdd annotation to current measure.
Annotation kind (e.g. "pp").
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation to current measure.
Annotation kind (e.g. "pp").
Annotation group (e.g. "dynamics").
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind (e.g. "pp").
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind (e.g. "pp").
Annotation group (e.g. "dynamics").
Optionaloptions: AnnotationOptions
Annotation options.
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: NoteOptions
Theory.Note options.
Add tie starting from last added note/chord.
T.Connective type ("tie" or T.Connective.Tie).
OptionaltieSpan: number | TieTypeValue
How many notes across this tie spans.
OptionalnotAnchor: NoteAnchorValue
Anchor point for note and this tie.
Optionaloptions: ConnectiveOptions
Optional values.
Add slur starting from last added note/chord.
T.Connective type ("slur" or T.Connective.Slur).
OptionalslurSpan: number
How many notes across this slur spans.
OptionalnotAnchor: NoteAnchorValue
Anchor point for note and this slur.
Optionaloptions: ConnectiveOptions
Optional values.
Add slide starting from last added note/chord.
T.Connective type ("slide" or T.Connective.Slide).
OptionalnotAnchor: NoteAnchorValue
Anchor point for note and this slide.
Optionaloptions: ConnectiveOptions
Optional values.
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: LyricsOptions
Lyrics 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: LyricsOptions
Lyrics options.
Add new measure.
OptionalmeasureOptions: MeasureOptions
Measure options.
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: NoteOptions
Theory.Note options.
Add rest to current measure.
Voice id to add rest to.
Rest length (e.g. "4n").
OptionalrestOptions: RestOptions
Rest options.
Add notes of given scale in ascending order.
Scale.
Scale starts from note >= bottom note.
Number of octaves to add.
OptionalpitchLabelTarget: StaffTargetAdd annotation with span to current measure.
Annotation kind (e.g. "pp").
Span builder (e.g. span => span.measures(2)).
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation with span to current measure.
Annotation kind (e.g. "pp").
Annotation group (e.g. "dynamics").
Span builder (e.g. span => span.measures(2)).
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation with span to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind (e.g. "pp").
Span builder (e.g. span => span.measures(2)).
Optionaloptions: AnnotationOptions
Annotation options.
Add annotation with span to current measure.
Single or multiple staff/tab/group identifiers.
Annotation kind (e.g. "pp").
Annotation group (e.g. "dynamics").
Span builder (e.g. span => span.measures(2)).
Optionaloptions: AnnotationOptions
Annotation options.
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: string
Title of this docmument/musical piece.
Optionalcomposer: string
Composer of this document/musical piece.
Optionalarranger: string
Arranger of this document/musical piece.
Set instrument to use for playback for given voiceId(s).
Voice id or array.
Instrument name (string) or midi program (number).
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: BeamGroupingValue
Beam 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: BeamGroupingValue
Beam grouping (e.g. "3-2" for time signature "5/8").
Document builder class.