#ifndef UDO_PVSTOOLS #define UDO_PVSTOOLS ## /* Phase vocoder tools This file is part of the SONICS UDO collection by Richard Knight 2024 License: GPL-2.0-or-later http://1bpm.net */ opcode pvs_ifn2buffer, i, iiiii ifn, ifftsize, ioverlap, iwinsize, iwinshape xin ktimek timeinstk if (ktimek == 1) then ilen = ftlen(ifn) / ftsr(ifn) kcycles = ilen * kr kcount init 0 while (kcount < kcycles) do apos lphasor 1 ain table3 apos, ifn ffin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape ibuf, ktime pvsbuffer ffin, ilen + (ifftsize / sr) kcount += 1 od xout ibuf endif endop #end