MusicXML note attribute dynamics

• Dec 2, 2020 - 15:06

[This started as a bug report, but as I found out more, it turned more into an "observation". Sorry it's in the wrong forum section for that.]

The MusicXML syntax includes, as an optional attribute to a note element, the attribute dynamics. This is seemingly intended to convey the note property we speak of in MuseScore as velocity.

If MuseScore imports a MusicXML file in which one or more notes carries the attribute dynamics, then MuseScore dutifully makes the velocity property of the reconstructed note(s) as given by the dynamics attribute in the file.

But in the direction of the export of a MusicXML file, the situation is a bit complicated. If the velocity type for a note is "offset", then its velocity is not encoded into a MusicXML file. If the velocity type is "user", then the velocity is encoded into a MusicXML file. ("Offset" velocities are susceptible to MuseScore setting them for us automatically based on various things. "User" velocities are static.)

If we import a MusicXML file in which some or all notes have dynamics attributes, and (as described above) the velocity properties of the reconstructed notes are set as defined by these dynamics attributes, those notes are initially set with the velocity type as "user."

Thus, if we wish our notes' velocities encoded into a MusicXML file about to be exported, we must select all the notes and then, in Inspector, set the velocity type to "user". (To select all the notes, select the entire score, summon Inspector, and press the "Notes" button at "Select" area at the bottom.

Note that if this is done too early in the evolution of a score, it may spoil some of MuseScore's ways of automatically setting note velocities for us.

Best regards,

Doug


Comments

Presumably the rationale for not ending durations tagged as "offset" into a MusicXML file is this: In the original score, if we change the value of some dynamic mark (perhaps fff to ff), the played velocities of the subsequent notes will all change accordingly (the difference between the velocity properties of the notes being preserved on a relative basis).

There is no way to send forward this situation in a MusicXML file so that a witting receiving application could continue to enjoy that clever scenario. If the notes' velocities were encoded into the MusicXML file the way the notes would be played with the current situation of the preceding dynamic mark, if the scorist in receipt to this score were to change the preceding dynamic mark, the effective velocity for the notes as played would not follow. Pity.

So, apparently to avert this imperfect situation (not necessarily bad from the standpoint of the receiving scorist), MuseScore does not encode any velocity information at all into the MusicXML file for notes whose velocity type is "offset". So, at the receiving point, there is no per-note velocity information in the reconstructed score at all.

It would seem to me that, upon export of a MusicXML file, MuseScore should encode a velocity value for every note (into a dynamics attribute of the *note element), regardless of its velocity type. If the type of the velocity for a certain note were "offset", MuseScore should reckon what velocity would be used to play that note (in light of the current preceding dynamic mark), and encode that value into the MusicXML file.

Then, if the score were played at a point that received it via MusicXML, it would (as to note velocities), sound as it would have if played at the point of origin at the time when the MusicXML file was generated.

Just sayin'.

Doug

In reply to by Doug Kerr

After considerable reflection, I suggest that the following would be a desirable doctrine for the task of conveying via MusicXML the velocity properties of notes. It is not MuseScore specific. However, I will make mention of some specifics as to its application to MuseScore.

Generating a MusicXML file

The note should be given a dynamics attribute whose value is 100/90 of the play velocity the program would give the note if played. [The factor "100/90" is an artifact of the scale defined for the dynamics attribute.]

This should take into account the effect, if any, in accordance with the algorithm used by the program, of the dynamic mark in effect.

As to MuseScore, I assume that this works from the assigned velocity of the note on either an "offset" or "user" basis.

Interpreting a MusicXML file

The reconstructed note should be given the assigned velocity that would cause the program, if the note were played, to give the note a play velocity of 90/100 of the value of dynamics for the note in the file.

This should take into account the effect, if any, in accordance with the algorithm used by the program, of the dynamic mark in effect.

As to MuseScore, I suggest that the assigned velocity of the note be made on an "offset" basis.

Best regards,

Doug

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