Rory already mentioned it but, besides that is using pvswrite from Csound, is to use the pvanal utility program to generate a PVOC-EX (a pvx file). This is usually called the “pre-analysis pass” in the biz. Yes, before the real-time streaming opcodes became a thing, pre-analysis was the only way I guess. Here’s how you do it
csound -U pvanal [flags] infilename outfilename
alternatively:
pvanal [flags] infilename outfilename
example:
pvanal -c 2 -n 1024 guitar.wav guitar.pvx (this analyzes channel 2, FFT size of 1024)
then when you are composing or performing Csound simply reads from that pvx file using pvoc, vpvoc, pvadd or one of those opcodes that read “pvoc files” (which is what the manual calls pvx or PVOC-EX files). In the example you might do this in your csd file:
ares pvadd kpoint, semitone(3), "guitar.pvx", -1, 120 (resynthesizes the first 120 bins from the FFT analysis stored in the pvx file, transposed up a minor third)
I’ve been looking into this method myself because pvanal has a powerful set of flags that let you fine-tune the analysis and do “spectral extraction”.