How Do I Program Like This?

There is a script called ‘sustain sampled instrument’ that gives you this mpc like triggering behavior in Renoise: