Progressive Action Issues

I had a situation where I needed to play a specific VST on a specific keyboard. I often use multiple VSTs for a single song and sometimes have to compromise on what keys are assigned to each VST. In this case, I felt like I was banging the low notes like a gorilla to get them loud enough and playing like a little girl to have the higher notes soft enough. I thought of several ways I might resolve that problem. For this instance, I decided to write a scriplet that allows me to adjust the velocity progressively across the keys. Sometimes you play a VST that expects progressive action with a VST that doesn’t like that. And sometimes you play a keyboard with constant action that wants it to be progressive. While the script does not change the weighting of the keys, it does compensate for the velocity differences created/needed for each. I thought I would share it in case someone else has need of such a thing.

Progression Fix.zip (1.3 KB)

You can save that zip file in your attachments and just add it to whatever raskspace needs it. Just wire the output of a MIDI block to the input of that script and wire the output of the script to your VST or other first block in your process chain.

Or, you can copy this into your own script block.

    nVel : Integer
    dVel : double
    factor : double = -20.0   // percent change for note 126
    offset : double = 20.0    // offset added to velocity for each note

Initialization
   SetInfoMessage("A Scriptlet to compensate for velocity progression differences between hardware and VST.")
   SetDisplayMessage("Progression Fix v1.0 - @_wo1f")
End

On NoteEvent(m : NoteMessage)
    nVel = m.GetVelocity();
    if nVel > 0 then
        
        dVel = (IntToFloat(nVel) + ((IntToFloat(GetNoteNumber(m)) / 127) * (factor - offset))) + offset
                
        if dVel > 126 then
            dVel = 126
        else
            if dVel < 1 then
                dVel = 1
            end
        end

        nVel = Round( dVel )
        
    end
 
    SendNow(WithVelocity(m, nVel))

End

Adjust the “factor” variable to represent the rate of progression you need. A negative number will reduce the velocity higher notes and a positive value will increase velocity of higher notes. “offset” will increase or decrease the overall change. You may have to experiment to get the right progression. It does include code that makes sure you do not exceed the minimum and maximum values allowed for velocity.

1 Like