There are a few different ways to control the duration of a sample.
# begin "0.5"
to change the start point of sample playback. The value is a percentage of the length of the sample.
# end "0.8"
can be used to change the end point of sample playback.
# legato "1"
Legato can be used to shorten or extend the space the sample takes up. A value of 1 means that the sample will take up it’s natural slot in the pattern and be cut off at the end of that slot. A value less than 1 will shorten the sample and a value greater than 1 will allow the sample to take up more space in the pattern.
Legato can also be used to control the length of synth notes.