I’m digging into the FFT department of Csound right now and i’m still trying to understand some Stuff out of the Floss Manual.
I try to get my head around this UDO:
opcode FileToPvsBuf, iik, kSoop kTrig, Sfile, iFFTsize, iOverlap, iWinsize, iWinshape xin iFFTsize = (iFFTsize == 0 ? 1024 : iFFTsize) iOverlap = (iOverlap == 0 ? 256 : iOverlap) iWinsize = (iWinsize == 0 ? iFFTsize : iWinsize) if kTrig == 1 then iLen filelen Sfile kNumCycles = iLen*kr kCycle init 0 while kCycle < kNumCycles do aIn soundin Sfile fftin pvsanal aIn, iFFTsize, iOverlap, iWinsize, iWinshape iBuf, kTim pvsbuffer fftin, iLen+(iFFTsize/sr) kCycle += 1 od endif xout iBuf, iLen, kTim endop ;--------
Especially these lines:
kNumCycles = iLen*kr
iBuf, kTim pvsbuffer fftin, iLen+(iFFTsize/sr)
I try to explain what i understand and maybe you can correct me or explain it with your words? This would definitiv help me with understanding this.
kNumCycles = iLenkr → setting the length / duration of the loop to read the whole soundfile into the buffer. iLenkr is the Length of the Soundfile in kCycles?
iBuf, kTim pvsbuffer fftin, iLen+(iFFTsize/sr) → iLen+(iFFTsize/sr) i don’t get this at all. Is just adding something to make the buffer circular and the first value is overwritten?
Maybe someone can help me.
All the best,