How do I change chord durations via a plugin in MS3

• Oct 18, 2024 - 21:39

This code processes through the score's tracks and attempts to set each chord to a 1/16 duration. However, it only actually applies the 1/16 setting to whichever note happened to be selected when the plugin started. (The pad-dot and voice-1 statements are commented out).

Any suggestions as to what I'm missing would be most welcome.

Set16.png


Comments

Got it working with:

Set16a.png

but it's very slow at about 2s per measure so I need to work out what's slowing it down. I have several other plugins and they all run very quickly but they don't involve changing note face value durations.

In reply to by elsewhere

One must pay attention at the elements that are te-written, such as dynamics, chord symbols, articulations. In order to not loose them in the output score.

How are you managing this?

I have built one system for this in Duration Editor, but it has room for improvement.

In reply to by yonah_ag

My remark was more targeted to @elswhere approach.

BTW, I wonder if you are forced to work on a note by note basis as you are doing right now:
Wouldn't it be possible (once you have identified the shortest duration) to
1. select all the chords and rests from voice 1 and call on that selection the correct cmd("pad-note-xx")
2. Process the same for each voice => max 4 calls to cmd("pad-note-xx")
3. select all the chords and rests from voice 2 and call on that selection the correct cmd("voice-1")
4. Process the same for each voice => max 3 calls to cmd("pad-note-xx")

In reply to by parkingb

Nice idea.

I haven't used selection methods much in plugins but I presume, (from your suggestion), that I can programatically build a non-contiguous selection with plugin code. I've just finished v1.2 which deals with ties better and removes unisons so now I can work on optimising.

In reply to by parkingb

I'm thinking of a slight variant. Why not process all voices together?

  1. For each value of XX, select all notes in all voices that need this new duration then use pad-note-xx.
  2. Select all notes not in voice 1 then use voice-1.

Is there a reason that I need to process voices separately?
(The note-by-note processing was inherited from the TAB Ring plugin which was initially used to host the voice merge code.)

Let me make a premise: I often create scores of classical music, and for this purpose I use (if I find them) midi files with the piece I need, so I save time. Sometimes importing a midi file produces disconcerting results: for this purpose I created a plugin ('Select overlapping tied notes' which I published in the dedicated section of Musescore), which improves the readability of the file. If you export your scores in midi format, and then reload them into the software, following the plugin's instructions you should get the result you need.

In reply to by yonah_ag

As you wish, my plugin simply selects overlapping notes with ties for their eventual deletion. Almost everything else (reduction to a single voice, elimination of staccato notes, and more) it doesn't do because Musescore can do it for me. This is my philosophy...

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