Skip to main content

Element Position

There are alternative functions to add elements.

FunctionAlternative
addLyricsaddLyricsTo
addFermataaddFermataTo
addNavigationaddNavigationTo
addAnnotationaddAnnotationTo
addLabeladdLabelTo

These alternative functions containe extra first argument: staffTabOrGroup.

staffTabOrGroup tells where this element will be added to, and it can be:

  1. Staff/tab id.
  2. Staff/tab/group name.
  3. Array of above ids or names.

Examples

Add element to top staff/tab (id 0).

builder.addLabelTo(0, "chord", "Am");

Add label to top two staves/tabs (id 0 and 1).

builder.addLabelTo([0, 1], "chord", "Am");

Add label to a named staff, tab or group.

builder.addLabelTo("staff1", "chord", "Am");
builder.addLabelTo("grp1", "chord", "Am");