Element Position
There are alternative functions to add elements.
| Function | Alternative |
|---|---|
addLyrics | addLyricsTo |
addFermata | addFermataTo |
addNavigation | addNavigationTo |
addAnnotation | addAnnotationTo |
addLabel | addLabelTo |
These alternative functions containe extra first argument: staffTabOrGroup.
staffTabOrGroup tells where this element will be added to, and it can be:
- Staff/tab id.
- Staff/tab/group name.
- 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");