MS4 plugin equivalent of MS3's note.veloOffset

• May 16, 2025 - 16:40

In MS4's plugin API, note.veloOffset does not seem to work. What should I be using instead?


Comments

I discovered something interesting... which should however be verified (I only tried with a score with a single instrument).
I did this:
1) I saved in mscx a file containing velocity variations created with 3.6.2;
2) I uploaded this file in 4.5.2 and saved it in the uncompressed folder format;
3) I loaded both mscx files into a text editor and I replaced in the file created with 4.5.2 all the part that starts from the first staff to the end of the file, with that of the file created with 3.6.2.
By loading the modified file in MS 4.5.2, the velocities are magically read.

In reply to by ILPEPITO

Sounds as though the file structures are the same from the first staff onwards, so that the replacement works without breaking anything. I've got the plugin working now but I'll test your discovery too as it's less user effort. I'll run a comparison check on the 2 chunks of score in MS3.7 and MS4.5.2 just to confirm that nothing is different that could cause an issue.

The only possible advantage of the plugin would be that nothing breaks if the MS4 score has had any edits after being created from the MS3 score.

It really makes me wonder why MS4 flattens velocities to 64 when they can be so easily preserved.

Thanks for the heads-up. 🙂

In reply to by yonah_ag

The solution I proposed is obviously all to be verified (it may be that some data is loaded in a different way causing some anomaly), and the fact that it still worked, makes me suspect that the failure to load the 'velocity' is due to a bug. However, I think that for the majority of users it is definitely better to have a plugin than to 'mess' with mscx files...

In reply to by ILPEPITO

It's such a niche plugin that it's probably only me and scorster that would use it. It is, however, safe. It looks for matching notes on matching tracks and only updates velocity when a match is found. In the event of any bugs there is a simple remedy: select all notes and set velocity to 64, which is what MS4 does to MS3 scores anyway.

I'll still check your solution because I'm intrigued by it and also because it will be useful for other development work to know whether the formast are the same after the first stave section. I have an Excel/VBA based file viewer for MS3 mscx files and it might prove useful for MS4 as well.

In reply to by yonah_ag

I'm glad to have come across this spirited discussion.

yonah_ag wrote > "It really makes me wonder why MS4 flattens velocities to 64 when they can be so easily preserved."

Indeed. On importing a legacy score MS4 could

... in the case of offset type velocities:

    • convert offset velocities to a user velocity equivalent (correctly or approximately calculated)

... in the case of user type velocities:

    • leave user velocities unchanged, rather than converting them to velocity 64. If there's some reason that MS4 can't effectuate user velocities them (like an inherent MS4 note velocity incompatibility with MuseSounds) don't change the values, simply ignore them. MS4 "ignores" LEN values and thankfully does not change them. HTML ignores double spaces without deleting them. Why not this approach to legacy note velocity in MS4?

In reply to by ILPEPITO

I have confirmed that your solution works and there appears, (ultimately), to be no loss in information. However, a direct comparison of the files is not so easy for a few reasons:

1) MS4 adds an eid tag to all elements
2) MS4 formats some previous multi-line XML onto a single line
3) MS4 has occasional, additional XML lines.

However, all these are re-instated on re-saving the tweaked file from MS4, (hence my "ultimately" above). This process could be automated via a plugin using FileIO but I'm a bit reluctant to trust my scores to a process that is deliberately 'breaking' the MS4 MSCX file and assuming that MS4 will piece it all back together correctly every time.

I am also inclined to agree that the failure to load velocity from an MS3 file is a bug, especially as the velocity tags and values are kept when saving from MS4. So, once you have velocities in MS4 it keeps them but when opening an MS3 file in MS4 it initially throws them away = Bug! (or, at the very least, a poor design decision).

On the plus side, my Excel/VBA MSCX viewer works perfectly with MS4 files.

MuseFx.png

In reply to by yonah_ag

The important thing is that the data interpretation algorithm does not create problems. I limited myself to a second experiment by including in the score some of the most common 'objects' (lines, dynamics, fingerings, tremolos, etc.) and there don't seem to be any problems, but to be sure you would have to include everything, and the matter would become boring!
I agree that it would be pointless to create a plugin for this; personally i created one that 'disassembles' the tracks of an MSCX file into separate files (with the algorithm that identifies the version of the program, because, as you have seen, there are small differences between one version and another), but in this case it is done manually first.
eid...Encrypted ID? Element ID? Extreme IDiot? eh eh eh...

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