Beginner wants to create a kind of sample player

I want to develop a patch with my own ideas but based on a sample player. The manual and the Di Berardino book both don’t seem to explain how to build a sample player. All of the existing sample player patches are stuffed with additional features but I’m a PD beginner and all those features only confuse me and make the code too complex to understand.

So I’m trying to find a dead simple basic sample player patch that really does nothing but play 1.wav or 2. wav etc. from start to end, and then repeat (loop) them, when the corresponding key is pressed. No sampling, no sequencing, no effects at all, just the sample player, as simple as possible, the samples should play back entirely and looped, not even polyphonically, just one sample at a time.

You may want to look into the sfplayer~ object. Its very easy to use. You just provide the sample path and hook up a start and stop message

Alternatively, you can load the sample into an array but that requires more work as you need to do some math with the sample rate to find out the rate at which a tabread4~ needs to be fed. You can also use the tabplay~ object. This video helped me understand samplers when I was starting out.