Sampler Hold Mode and On/Off loop

Would there be a way to add the ability for hold mode (depress pad/key keeps sample playing until released, and then it stops as soon as it is released?

Also, on/off loop: keeps looping sample and plays until turned off.

This function would be great to be implemented.
Indeed, when we use samples, we would like to synchronize them with the beat, without having to click manually and to try to respect the rhythm!