Section StavesGroups

StavesGroup utility functions

See
StavesGroup
Staves
Staff

Summary

Return typeFunction and summary
tableChooseStavesGroups(Score score, boolean multiple, boolean visibleOnly, function filterFunc, function selectFunc)
Ask the user to choose one or multiple staves groups.
tableGetStavesGroups(Score score, Staff staff)
Get all StavesGroups of the score or containing staff if this argument is provided.
tableGetStavesInGroup(StavesGroup sg)
Return an array of staves in StavesGroup sg
stringStavesGroupName(StavesGroup sg)
Return the name (title) of sg or build a name from its first and last grouped staves.

Functions

GetStavesGroups(Score score, Staff staff)

Get all StavesGroups of the score or containing staff if this argument is provided.

ParameterTypeDefaultDescription
scoreScore score
staffStaffnilIf nil, return all StavesGroups of the score, else return the ones containing staff.
Return
table: An array of StavesGroups, ordered from first to last Staff (Score.FirstStavesGroup is the first created in the document, not the first printed). Array is empty if no StavesGroups found.
Error
if score is not a Score or staff is not a Staff

GetStavesInGroup(StavesGroup sg)

Return an array of staves in StavesGroup sg

ParameterTypeDefaultDescription
sgStavesGroup sg
Return
table: Array of Staff

StavesGroupName(StavesGroup sg)

Return the name (title) of sg or build a name from its first and last grouped staves.

ParameterTypeDefaultDescription
sgStavesGroup sg
Return
string: Unstyled string
Error
if sg is not a StavesGroup

ChooseStavesGroups(Score score, boolean multiple, boolean visibleOnly, function filterFunc, function selectFunc)

Ask the user to choose one or multiple staves groups.

ParameterTypeDefaultDescription
scoreScore score
multiplebooleantruetrue if several staves groups can be chosen, false if only one staves group can be chosen.
visibleOnlybooleantruetrue if only visible staves groups are provided.
filterFuncfunction Function that receives Score and StavesGroup arguments, returns true if the staves group appears in list, false if not.
selectFuncfunction Function that receives Score and StavesGroup arguments, returns true if the staves group is selected by default, false if not selected.
Return
table: Array of choosen staves groups, can be empty, or nil if user canceled the choice.