How to play samples (not as one shots

want to play and audition my samples with midi keyboard, but want them to stop when i let the note off, one shot hurting me but good for other times thanks…