I was working on these utilities for SF2/XI instrument inspection/conversion and what not more. The tools might be buggy, but serve as a good startingpoint, as I did not find any other simple sourcecode which does this on the commandline.
There are many looped instruments out there (.xi/.sf2), and there are many software DAW`s (cubase/ableton) and hardware tools (electribe esx/old samplers) which support .wav looppoints. However, there isnt many software out there which uses these features. Also, conversion tools usually cannot be used in batch, which can be a big pita.
mkdir in out
# copy all your instrument files to directory 'in'
./convert instr2raw foo.xi out
./convert instr2raw foo.sf2 out
./convert rawdir2wav outdir
or a whole collection at once:
./convert dir myinstrumentdir outdir
For more verbose output run the convert command with '—verbose' as last argument. Also, if you feel up to it, turn on the DEBUG-flag in the Makefile for crazy verboseness =]. sf2toraw and xi2raw also generate loopfiles which the shellscript convert uses for batchpurposes. But with little effort you can inject loopdata into aiff/wav-files yourself. You can just call the loopinject command manually and insert the looppoints.
handle stereo files (mono only since my hardware supports monolooped instruments only)
aiff generation/injection possible but convert shellscript is not finished concerning aiff output