plugin Clone staffs and generate new tablature staffs

• Sep 17, 2021 - 22:16

Hello everybody,

I am new to this forum. I am using musescore since years. Now I have written my first plug-in for the new api.
With this plug-in I need some help to improve it.
The plugin copies everything within a selection. If nothing is selected, the plugin selects the whole score.
After that new staffs are generated:
1. Guitar tablature
2. ukulele tablature
3. mandolin tablature

I have 3 points that I would like to improve:

  1. When the plugin pastes the copied selection into the new generated staffs, musescore says: "no target to insert". --> I solved the problem with doubling the cmd("paste") command. But the error message still remains. How can solve this problem better, becausen I don´t like to get an error message?

  2. When the plugin generates the new staffs, the staffs are shown as classical notation and not as tablature. The plugin generates the staffs like this: curScore.appendPart("ukulele-4-str-tab")
    How can I generate the new staffs so that I have already Tablature-staffs? In the moment my solution is the instruments dialogue. In the dialogue I can change the staff to tablutre after generating the staffs. But I would like to do it automatically.

  3. At the end of the plugin I would like to generate new excerpts for the new staffs. How can I do this?

I would be very happy if someone could point me in a direction.

best regards

Attachment Size
issue.jpg 25.14 KB
210917StaffClones.qml 5.48 KB

Do you still have an unanswered question? Please log in first to post your question.