General dynamics errors
This becomes here much more subjective. We have two ways to detect these errors: First, we can have the same idea as for note duration: compare the played note's velocity to the expected one, and validate it with a threshold:
(expected velocity - ) < v < (expected velocity +
)
The second way would be to define a "velocity scale" which would give, for each velocity value, the corresponding dynamic:
Between 0 and 10 : ppp
Between 10 and 20 :pp
Between 20 and 40 :p
Between 40 and 60 :mp
Between 60 and 80 :mf
Between 80 and 100 :f
Between 100 and 120 :ff
Between 120 and 127 :fff
The great advantage of this solution is an independant definition of dynamics. If rhythm is a fuzzy concept and can be different from a piece to another, a mezzo-forte will always be a mezzo-forte, and this notion is totally independant of the musical style of the piece.
Accentuation errors
We must here consider note velocity in comparison with both previous and next note. If the note should be accentuated, then we can say we have no error if:
( v > Velo(previous note) + ) AND ( v > Velo(next note) +
)
For accentuation problems, we just need relative velocity: we don't care about absolute values, since the wanted effect of an accentuated note is to make contrast.