Apply Measure Repeats
apply_measure_repeatsConverts bars of one staff into 1-, 2- or 4-bar measure-repeat signs by backing up the score, writing the signs into the file and reloading it, since MuseScore's plugin API cannot place them.
Instructions
Turn bars of one staff into measure-repeat signs (1-, 2- or 4-bar) automatically. MuseScore's plugin API cannot place these signs, so this saves the score, backs the file up, writes the signs into the file and reloads it in MuseScore. The reload resets MuseScore's undo history: use restore_backup to undo. Each sign repeats the bars just before it, and the replaced bars' notes are deleted. Bars with ties or slurs crossing their barlines are skipped and reported. Pass all groups for a staff in one call.
Tool call template
Replace each placeholder with a value matching the input schema. Only required parameters are included; add optional parameters as needed.
{
"id": 1,
"jsonrpc": "2.0",
"method": "tools/call",
"params": {
"arguments": {
"staff": "<staff>",
"groups": "<groups>"
},
"name": "apply_measure_repeats"
}
}Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| staff | Yes | Staff index (0-based) | |
| groups | Yes | Runs of bars to replace, e.g. [{"start": 7, "end": 12, "bars": 1}] | |
| score_path | No | Path of the score file. Defaults to the file of the score open in MuseScore. |