Improved Implode/Explode tool

Posted 8 years ago

In this blog post I want to outline some general ideas of an improved Implode and Explode tool.

Recently there have been several problems with these tools. The actual implementation was done by Marc Sabatella out of a plugin he has written before.

Implode

To use Implode, you have to select complete measures, if you have just selected one staff, it will merge the notes in each voice of the staff to the first voice. If you have selected more than one staff, it uses the first voice of every staff and merges the notes to the first voice of the topmost staff.

same_imp.png The top line is the output of Implode, if the Vocal part is the same as the Sopran part.

So there are two main problems:
Problem 1 - If you have a staff with more than one voice or your notes are not in the first voice, the notes except of the notes in aren't merged.
same_imp_voice2.png

Problem 2 - If there are different rhythms in the selected staffs or voices, they don't get merged, but they are aligned to the topmost staff or voice.
notsame_imp.png

If you're selecting one staff with different voices, it is actually not planned to have a different merge behavior than the actual, so it won't be possible to merge different rhythms here without some data loss.

To handle those problems I want to copy each voice in the selected staffs to the topmost staff of the selection, so it would look like this: tovoice.png

Sure, at the first moment it doesn't look very good, but I think this is the right way, because the Implode tool should be a very basic tool, which doesn't have many extras, because there are many different ways to use this tool, for example for a piano reduction or an "a2 merge". In most scenarios it'll be used to combine two voices in one staff and this seems to look quite good. One disadvantage is, that it won't be possible to merge more than four voices to the top staff but as I said, this won't occur often.

For the implementation:
I'll copy the voices to the top staff and use the already existing exchangevoices tool to do this. The steps are described here.
There have to be done some additional checks:

How many voices do I have selected? If more than four throw an error.
Does any voice contain nothing else than rests? If yes, ignore it.
For every staff it has to be checked which voices occur. Copy them to the top staff, but make sure, they do not overwrite an already existing voice.

It should be possible to select voices with the selection filter and merge them to the staff of the topmost voice (see the discussion.). Here we have to make more checks, for example in the topmost staff there could already be more than one voice, but we just select one of it so the other voice would have been overwritten. This could be a helpful feature, but let's see how far I can get.

For the moment the dynamics will be lost on the implode progress. This is the current behavior of the similar tools in Finale or Sibelius. For an additional tool like a piano reduction, there might be found an algorithm to merge this, too.

Explode

For the Explode tool, there will be two different methods.
If there is only one voice which contains something else than rests, it will split the chord to the staffs under the selected staff. This is the current behavior which will be extended, so you could also explode a chord in the second voice.

The second behavior of the Explode tool would be, if there is more than one voice in the selection it will expand every voice to the staff under the selection and not split the chords in the voices. This will be achieved using the selection filter and a simple copy.

In the next days, I'll go over to the part creation tool, which is my second project. This tool should create parts for a voice of an instrument.

If you have some criticism, advice or just want to talk, let me know!