1

Topic: Note off bug

I had noticed rare occasions where notes would continue to sound after releasing the key, which was annoying until I sussed it. After a search, it doesn't look like this bug has been noticed before - basically, a note-off event won't be read with a note-off velocity of zero, meaning the note will continue to sound after you've let go of the key.

To replicate:
- Use a piano/controller which supports note-off velocities
- Set the note-off curve as a straight line from 0 on the left to 127 on the right
- Play a note as hard as you like, then let go very gently

Workaround:
- Set the note-off curve from just above 0 on the left

Alternatively, setting the note-off curve from 0 to 0 causes all note-off velocities to be ignored, and this can possibly be replicated on any controller keyboard.

No biggy, since the workaround is simple, but hopefully an easy fix for the dev for any future release.

2

Re: Note off bug

Note-off of 0 doesn't seem to be read by Pianoteq (lowest value received is 1, you can see this in Pianoteq's MIDI monitor. I think this is intentional, and note-off of 0 means "note was never released" so it acts as if sustain pedal was pressed.

I think this works as intended in Pianoteq. This is why you can use the note-off curve to shape the note-off response to how you like it.

Last edited by EvilDragon (21-05-2017 09:42)
Hard work and guts!

3

Re: Note off bug

EvilDragon wrote:

Note-off of 0 doesn't seem to be read by Pianoteq (lowest value received is 1, you can see this in Pianoteq's MIDI monitor. I think this is intentional, and note-off of 0 means "note was never released" so it acts as if sustain pedal was pressed.

I think this works as intended in Pianoteq. This is why you can use the note-off curve to shape the note-off response to how you like it.

Whether it works as intended is something I can't say, but from what I can see, it doesn't conform to midi standard. More importantly, it doesn't conform to reality - if you release a real piano key very, very gently, the note will stop, so Pianoteq should do the same thing.

4

Re: Note off bug

I haven't checked the standard, but I do know that a Note-On with a velocity of zero is an alternative way of specifying a Note-Off, so the valid Note-On velocities do NOT include 0, and thus the range is 1 to 127. I wouldn't be surprised if the valid range for Note-Off was also 1 - 127, but I am not sure.

Greg.

5

Re: Note off bug

Bankie wrote:
EvilDragon wrote:

Note-off of 0 doesn't seem to be read by Pianoteq (lowest value received is 1, you can see this in Pianoteq's MIDI monitor. I think this is intentional, and note-off of 0 means "note was never released" so it acts as if sustain pedal was pressed.

I think this works as intended in Pianoteq. This is why you can use the note-off curve to shape the note-off response to how you like it.

Whether it works as intended is something I can't say, but from what I can see, it doesn't conform to midi standard. More importantly, it doesn't conform to reality - if you release a real piano key very, very gently, the note will stop, so Pianoteq should do the same thing.

Actually, what has been noted before is that with very low note-off velocities (particularly noticeable with a value of 1) a similar effect occurs (this can be easily verified by changing the note-off curve), which I don't think matches the behavior of a real grand (unless it is meant to simulate a partial key release, but unfortunately there is then no way for Pianoteq to know when the full release occurs). This is why some of us using a VPC-1 (where producing a value of 1 during regular play does not seem entirely uncommon) adjust our note-off velocity curves to raise very low values to a higher one...

6

Re: Note off bug

Bankie wrote:
EvilDragon wrote:

Note-off of 0 doesn't seem to be read by Pianoteq (lowest value received is 1, you can see this in Pianoteq's MIDI monitor. I think this is intentional, and note-off of 0 means "note was never released" so it acts as if sustain pedal was pressed.

I think this works as intended in Pianoteq. This is why you can use the note-off curve to shape the note-off response to how you like it.

Whether it works as intended is something I can't say, but from what I can see, it doesn't conform to midi standard. More importantly, it doesn't conform to reality - if you release a real piano key very, very gently, the note will stop, so Pianoteq should do the same thing.

I don't get your point regarding reality: if you release a real piano key very, very gently, it means you do release it, so you have some positive release velocity, say 1 or 2... (not 0), and the note will stop after a certain time, whether an acoustic piano or Pianoteq. But, as EvilDragon said, velocity 0 means you do not release it all, not even "gently", so the sound lasts forever (well, as long as the instrument itself is capable).

7

Re: Note off bug

Philippe Guillaume wrote:

I don't get your point regarding reality: if you release a real piano key very, very gently, it means you do release it, so you have some positive release velocity, say 1 or 2... (not 0), and the note will stop after a certain time, whether an acoustic piano or Pianoteq. But, as EvilDragon said, velocity 0 means you do not release it all, not even "gently", so the sound lasts forever (well, as long as the instrument itself is capable).

The MIDI standard (the "MIDI 1.0 Detailed specification") does not explicitly specify a separate velocity definition for Note-Off events, but it is clear on Note-Off events always "turning off" the note. So for midi message stream consistency, any Note-Off events (a Note-On event with velocity 0 is considered a Note-Off event at velocity 64 as per the standard) would have to be interpreted as a release of the key.

While "interpretation of the Velocity byte is left up to the receiving instrument" (note that this does not exempt the SENDING instrument from obeying the further specification in the standard), in order not to violate the above condition, I believe there are only two ways of reading the standard:

a) You stick with "Generally, the larger the numeric value of the message, the stronger the velocity-controlled effect", and considering the special case indicated for velocity 0 to only apply to Note-On, you thus accept the entire scale from 0-255 as representing an increasing scale of the speed of release.
b) You apply the scale indicated at the end of the "VELOCITY" section to Note-Off verbatim. Then you get 1-127 for ppp-fff, and 0 for "off" with the clear definition in the caption of that scale: "vvvvvvv = 0: Note-Off (with velocity of 64)"

Of course, the conclusion from these options (b being a literal interpretation, but a probably a more likely actual implementation on the sending end) might be that the actual velocity of a Note-Off event with a transmitted velocity of zero is undefined.

But in either case, a Note-Off is still a Note-Off. (At the same time, obviously sending a Note-Off with velocity zero at all shows that the designers of the keyboard delivering it did not much care about the robustness principle.)

8

Re: Note off bug

Philippe Guillaume wrote:

I don't get your point regarding reality: if you release a real piano key very, very gently, it means you do release it, so you have some positive release velocity, say 1 or 2... (not 0), and the note will stop after a certain time, whether an acoustic piano or Pianoteq. But, as EvilDragon said, velocity 0 means you do not release it all, not even "gently", so the sound lasts forever (well, as long as the instrument itself is capable).

The reality is that keyboards/pianos which have velocity off will transmit values in the range of 0-127, so Pianoteq should interpret those accordingly. I don't think it's fair to suggest that a zero should mean you haven't released it, because it's clear that Roland et al haven't implemented it that way on their hardware. This isn't a damning critisism of Pianoteq - it's easy to work around - but from the outside, it looks like it would be an easy clean up job. Bandoneonista is correct about the other very small values too, btw; I noticed this soon after my original post.

9

Re: Note off bug

I'd be reporting this to Roland - IMHO Pianoteq is the more correct of the two.

10

Re: Note off bug

Bankie wrote:

The reality is that keyboards/pianos which have velocity off will transmit values in the range of 0-127

Well, when we look at the MIDI implementation charts, for example the one of the VPC 1 it says:
Note On: 9nH v=1-127
Note Off: 8nH v=1-127

So it does NOT say "0-127"!

The MIDI implentation chart of the Roland A-88 reads:
Note On: 9nH v=1-127
Note Off: 8nH v=1-127, (9n v=0)

Now I'm not quite sure what the latter term in parenthesis does actually mean

11

Re: Note off bug

Arkanda wrote:

The MIDI implentation chart of the Roland A-88 reads:
Note On: 9nH v=1-127
Note Off: 8nH v=1-127, (9n v=0)

Now I'm not quite sure what the latter term in parenthesis does actually mean

Ah, Wikipedia again can help:
Note on status byte 9n with a data byte 2 of zero means "note off".

So we here also never have a value of zero for Note Off, it always begins with 1

12

Re: Note off bug

(9n v=0) means if note on with value 0 is sent, it's recognized as note off, yeah.

Last edited by EvilDragon (23-05-2017 08:48)
Hard work and guts!

13

Re: Note off bug

Bankie, can you post a MIDI file that reproduces your issue ? (you can send it to https://www.pianoteq.com/support_form?direct if you prefer). I can't reproduce it, Pianoteq interprets note-off messages with a 0 velocity as note-off with a default (64) velocity, so maybe it was a note-off with a velocity of 1 that you heard ringing ?

14

Re: Note off bug

In Pianoteq's MIDI monitor, note-off with value 0 is not shown at all, it's shown as if it has a value 1. Perhaps this should be fixed, at least?

Hard work and guts!

15

Re: Note off bug

Strange, if I play a MIDI file containing note-off that have a zero velocity , I do see them as 'velocity: 0' in the MIDI monitor, are you sure they have a zero velocity ? (if yes please record a MIDI file)

16

Re: Note off bug

Ah actually it might be my MIDI controller, I tested via my Kurzweil PC3K8. Seems it doesn't send note-off of zero at all. Tried manually creating MIDI data in Reaper, now note-off of zero is recognized. All good!

Hard work and guts!

17

Re: Note off bug

julien wrote:

Bankie, can you post a MIDI file that reproduces your issue ? (you can send it to https://www.pianoteq.com/support_form?direct if you prefer). I can't reproduce it, Pianoteq interprets note-off messages with a 0 velocity as note-off with a default (64) velocity, so maybe it was a note-off with a velocity of 1 that you heard ringing ?

That form won't let me attach a .mid file, but I've uploaded to Dropbox. The final note has a note off velocity of zero: https://www.dropbox.com/s/s0t3196ss6iwm … g.mid?dl=0

For info, I'm playing on a Roland V-Piano. Midi.org unfortunately doesn't quote the range for Note Off in its summary, but on a Google search the first few specs I came across do quote the range 0-127 (e.g. http://www.indiana.edu/~emusic/etext/MI … I4.shtml). I still think regardless of whether a zero is valid or means something other than a note off that Pianoteq should regard it as a note-off, since ignoring it (or perhaps it's just sustaining it for far too long) doesn't serve any purpose whatsoever in the sphere of piano playing.

18

Re: Note off bug

It is not a note-off with a zero velocity, though, if you look into the MIDI monitor of Pianoteq when playing notehang.mid, it is registered as a note-off with a '1' velocity, so the note is actually dampered, even if very little.

So, for now, I suggest that you raise the lowest point of the 'note-off velocity curve' in Pianoteq, so that note-off with velocity 1 are actually dampered a bit faster.

Can you easily achieve any note-off velocity in the 1-127 range with your keyboard, or are those note-off with a '1' velocity rare accidents while most other note-off are in the 40-80 range (which seems to be the case on most keyboards with note-off velocity) ?

19

Re: Note off bug

julien wrote:

It is not a note-off with a zero velocity, though, if you look into the MIDI monitor of Pianoteq when playing notehang.mid, it is registered as a note-off with a '1' velocity, so the note is actually dampered, even if very little.

So, for now, I suggest that you raise the lowest point of the 'note-off velocity curve' in Pianoteq, so that note-off with velocity 1 are actually dampered a bit faster.

Can you easily achieve any note-off velocity in the 1-127 range with your keyboard, or are those note-off with a '1' velocity rare accidents while most other note-off are in the 40-80 range (which seems to be the case on most keyboards with note-off velocity) ?

Adjusting the note-off velocity curve is exactly what I do. Sorry, but as I've never played a real piano (well, not since I was a teenager about 27 years ago when I couldn't play) I'm a bit lacking in knowledge on this, but does a real piano actually continue to sound for a lot longer if you let go of a key very gently?

To answer your question, I can easily get these low note-off velocities on purpose, and I get them from time to time by accident (say, every 3 or 4 minutes or so). Whether that means bad technique or not, I've no idea.

As a complete aside, I am booked in for a 15 minute session to play a Steinway Grand in June at the Glasgow West End Festival. Pretty excited!

20

Re: Note off bug

Bankie wrote:

Adjusting the note-off velocity curve is exactly what I do. Sorry, but as I've never played a real piano (well, not since I was a teenager about 27 years ago when I couldn't play) I'm a bit lacking in knowledge on this, but does a real piano actually continue to sound for a lot longer if you let go of a key very gently?

Yes, although on a real piano the release time depends on the key position, not its velocity. As long as the key is depressed more than halfway (approximately), the damper remains lifted, hence is not in contact with the strings, and the sound lasts as long as it can.

BTW, when playing normally, a digital piano should not send release velocities lower than say 10. Those velocities should only be achievable when exaggerating a lot the release time. The good news is that even if that happens, you can correct it easily by adjusting the release velocity curve adequately.

21

Re: Note off bug

Philippe Guillaume wrote:

Yes, although on a real piano the release time depends on the key position, not its velocity. As long as the key is depressed more than halfway (approximately), the damper remains lifted, hence is not in contact with the strings, and the sound lasts as long as it can.

Ok, so the sound won't continue when you do actually release the key fully, no matter how hard or soft you do it. Reading the midi spec, it appears it's up to the hardware manufacturer how they implement note-off velocities, so they'll obviously set them up for their own hardware rather than Pianoteq so what they send is neither "right" nor "wrong". I'm curious about the furious defence of Pianoteq and the idea that low note-off velocities shouldn't be sent to it. What's the point of that part of the range then? If Pianoteq treated these as completely released keys, there would be absolutely no detrimental effect.

22

Re: Note off bug

Bankie wrote:
Philippe Guillaume wrote:

Yes, although on a real piano the release time depends on the key position, not its velocity. As long as the key is depressed more than halfway (approximately), the damper remains lifted, hence is not in contact with the strings, and the sound lasts as long as it can.

Ok, so the sound won't continue when you do actually release the key fully, no matter how hard or soft you do it. Reading the midi spec, it appears it's up to the hardware manufacturer how they implement note-off velocities, so they'll obviously set them up for their own hardware rather than Pianoteq so what they send is neither "right" nor "wrong". I'm curious about the furious defence of Pianoteq and the idea that low note-off velocities shouldn't be sent to it. What's the point of that part of the range then? If Pianoteq treated these as completely released keys, there would be absolutely no detrimental effect.

I didn't say  that low note-off velocities shouldn't be sent to Pianoteq. On the contrary, if a key is released very slowly and the keyboard sends a low release velocity to Pianoteq, that isn't a problem, the sound will last a certain time (the time the damper would have taken to reach the string in the case of an acoustic piano) and everything is fine.

The only 'problem' is when a keyboard sends a low release velocity whereas the key hasn't been released slowly, which does happen on several digital keyboards. Then, if you use Pianoteq's default release velocity curve, you won't be happy because the sound will not correspond to what you have played. But actually this is not a real problem, as you can adjust Pianoteq's release velocity curve to get the proper response.

The fact that you have to adjust  Pianoteq's release velocity curve to a given keyboard is unavoidable: there is no standard withing the hardware manufacturers, so you cannot expect a given release velocity curve to work fine in all cases.

In conclusion, there is no problem, only the fact that you may need to adjust  Pianoteq's release velocity curve, depending on your hardware.

23

Re: Note off bug

I think I've posted too much already for such a minor issue, so this summary is my last word on it.

- When my V-Piano sends low note-off velocities, it's because of my playing and not an issue with the keyboard. The note-off is triggered roughly halfway back (which appears to be realistic according  to what's been said)
- I would expect low velocities to have quiet key release noise (which happens), and the note to cut off quickly no matter what
- Pianoteq doesn't cope properly with low note-off velocities and continues to sound notes far too long
- The workaround of adjusting the velocity curve is perfectly acceptable. It's no big deal, and any adjustment to the algorithm would simply be a tidy-up.