the simplest way is just to edit your sample in a sound editor so that the start and end points both ramp to zero. use about a 5-10ms fade in/out on each end.
the nest simplest way is to do exactly the same process in realtime in pd. when you load your sample into a table with [soundfiler], the output of [soundfiler] gives you the sample length in bytes. just divide this by your samplerate (usually 44100), or you can use the [samplerate~] object to make a generic one. then you have your sample length in milliseconds. subtract 5 milliseconds from that value to account for the ramp down time, and feed it into the [0, 1 5, 0 5 $1( message in the construct below. the millisecond value must be banged at the same time as the [tabplay~]
[tabplay~]
|
| [0, 1 5, 0 5 $1(
| |
| [vline~]
| |
[*~ ]
otherwise, there are also some crossfade samplers and whatnot in the pd audio documentation.