http://www.xoxos.net/sem/sample0.zip
this is an elementary file.. loads wav, triggers play on gate, changes pitch. you should be able to look at the source and figure out what's what, and what you can change in order to add the features you want.
it's not optimised or particularly informed (it works but may not be the best or the conventional way of doing things) so don't take the code as scripture, but it's simple
it loads all the 8 and 16 bit wav i tested... the wav loading routine is definately not coded with proper consideration for the variety of wav formats, and it has a real crappy, cheeky bit of code that will load a few more.
http://www.xoxos.net/sem/sample1.zip
this version is not optimised et c. either. it adds loop and start and end points, and wrap/bounce looping modes. reverse play is accomplished by making the start position higher than the end position. i finished late, so hopefully i caught everything...
neither have interpolation (there's code in the pdf on the sem page) both have sleep added, so they ought to work as a basis for modding