Or try this scriptlet:
//Called when a NoteOn or NoteOff message is received
//Note: this will NOT be called for NoteOn/NoteOff messages if you have explicit
//NoteOnEvent/NoteOffEvent respectively callbacks defined
//Called when a NoteOn or NoteOff message is received
//Note: this will NOT be called for NoteOn/NoteOff messages if you have explicit
//NoteOnEvent/NoteOffEvent respectively callbacks defined
var Latency : Parameter 0..1000 = 0
On NoteEvent(m : NoteMessage)
if IsNoteOn(m) then
SendLater(m, RandomRange(0, Latency))
else
SendNow(m)
end
End