Midi Velocity curve min value to 0?

I wrote a Scriptlet which will allow you to set a threshold parameter for velocity, which will block any note-on messages if their velocity is below that threshold value.
In the example gig rackspace you can see how this Scriptlet is used.
Just insert it in any MIDI-signal flow and, if desired, use a widget to set the threshold parameter.
Best if you right click the Scriptlet in the wiring view and save it as “Favourite”, so it will be instantly available to be inserted in your own projects.

block note-on by velocity.gig (30.1 KB)

This is the code which works in the Scriptlet:

var
Threshold : Parameter 1 .. 127 = 40 // Sets the threshold value for Note-On filtering

Initialization
   SetDisplayMessage("Block Note-ON by velocity")
   SetInfoMessage("Use this scriplet to detect when an incoming Velocity value goes over the specified Threshold value. As long as the actual velocity value of a played note stays below the threshold,the note won't be played")
End

//Called when a NoteOn message is received
On NoteOnEvent(m : NoteMessage) 
    If GetVelocity(m) > Threshold Then
        SendNow(m)
    end
End

…hope this helps. :beers:

5 Likes