remove() method for rests not implemented

• Mar 20, 2013 - 10:31
Type
Plugins
Severity
S5 - Suggestion
Status
duplicate
Regression
No
Workaround
No
Project

I want to write a plugin for removing a whole voice or for removing invisible notes/rests for a better print-layout. It's only possible to remove a note (chord.removeNote(i)), a rest (or a whole voice) can't be removed.

WinXP, MuseScore 1.3


Comments

It's not possible to remove a rest on voice 1 even in the GUI. I'm not sure how removing invisible rests/notes would make a better print layout. Maybe (and please forgive me if I'm wrong), it would be better to tackle the problem instead of trying to write a plugin. Could you share a score to show which element you would like to remove?

In the new 2.0 plugin framework there is a remove method for chords, but none for rests (nor for notes?) It should be made possible to remove (none-voice 1) rests via a plugin.

chordrest.h and element.h have:
virtual void add(Element*);
virtual void remove(Element*);

chord.h has:
Q_INVOKABLE virtual void add(Element*);
Q_INVOKABLE virtual void remove(Element*);

So makes it available to plugins, but rest.h (inheriting from chordrest) and note.h (inherting from element) are lacking it.

So you want to remove the entire voice, not just a rest?

Whatever: for 1.x there is zero chance that it will get changed in any form or shape.
But, as I pointed out, the same issue iseems to be true for thr 2.0 üplugin framework. so there's hope ;-)

Then again you 1.x workaround for trills playback may not be needed in the first place.

Thank you. But there are many trills in the score. Remove manually would be a great work. I had a look at VoiceCaster-plugin. But after extracting each voice to a different staff, the slurs are gone, and i see no way, to extract them too.

Removing a voice is relativly easy, interactivly:
select a note of that voice -> right-click -> select -> more... -> same staff and voice -> delete.
Repeat this for the rests that now take the place of the notes.


Q_INVOKABLE virtual void add(Element*);
Q_INVOKABLE virtual void remove(Element*);

are adding/removing things (such as note) to a chord.

Having this available in the plugin framework still seems reasonable to me - assuming it has been decided that deleting rests individually will be allowed at all in 2.0. I recall some discussion of the idea of not allowing individual rests to be deleted, but to instead have some sort of scheme where replacing the individual rests with a whole rest, or deleting them all at once, would clear the measure. So a voice would either be full or empty, but not partial as it can be for 1.x. If that were the case, then whatever replaced the idea of deleting individual rests, *that* should be accessible via plugin.

Title removeRest not implemented remove() method for rests not implemented
Status (old) fixed active

remove() still not implemented for rests...