Computation Bug in MIDI-Velocity Compression

I stumbled upon a bug (probably) in the MIDI velocity compression (Menu: MIDI-> Functions → Velocity → Compress/Expand).
It looks like this algorithm computes an average of all velocities in a clip and moves velocities of all selected notes towards it by a given percentage. My guess is: it should compute the average of only the selected notes but it takes the average off all notes in the selected clip. Which gives strange results. But lets look at it.

Steps to reproduce:

  • create an empty midi track
  • create a single clip in it
  • put several notes, pitch doesn’t matter (in my example its alternating g#2 and a#2 so you can tell them appart better)
  • enter velocities for all notes like in my both test cases below (select notes, double click the velocity value in the info line (?) at the top of the key editor, enter the value there and press ctrl+enter (windows) to apply it to all selected notes

Test case 1:
A lot of notes with velocity 0 and a single note with velocity 127.

Now we compress just the first two of them
s8 s2

Result: Both notes have very low velocities now.

Test case 2:
A lot of notes with velocity 127 and a single note with velocity 0.

Again we compress just the first two of them with the same settings, basically this should do the exact same as above.
s5

Result: Both notes have very high velocities now.

This is an extreme case for testing. If you put fewer notes in the clip, the values go less extreme. This suggests that all notes in the clip are being taken in account for the computation of the average velocity, although it’s only applied to the selected ones and probably should only use those to calculate an average.

I’m on Windows 10, Cubase Pro 11.

sorry, first post was sent to early, I hope it’s fixed now.

can you do this: How to format a bug report

1 Like

Hi steve, thanks, I’ll try to fix it.

1 Like

Quick update on this bug for cubase 12 (pc/win 11):

the midi->velocity dialog’s expand/compress function still does use all the midi notes (mistakenly) in a part for calculating the average value, but applies the function only to the selected notes.

the average (calculated value towards witch the notes are compressed/expanded to) should correctly only be calculated from the selected notes.

so compress/expand only works correctly when applied to a whole midi part.
with a selection of notes it does only give a correct result, when the average velocity of the selected notes is the same as the average velocity of all the notes in that part.

2 Likes