Autotune portamento control problem – Csound Noobs

Hi, im trying to create an autotune, witch also has a portamento control between the notes. I figured that using port or portk would be the best option, but im struggling with where i should put the code, or if i would need to add more code than i already have done.

ksmps = 32
nchnls = 2
0dbfs = 1

;Major scale
;C-major
giSkala ftgen 0, 0, 7, -2, 0, 2, 4, 5, 7, 9, 11

instr 1

a1, a2 diskin2 “Sample”

kCps, kRMS pitchamdf a1, 80, 800, 0, 1

kOct = octcps(kCps)
kDesi = frac(kOct)
kOktav = int(kOct)

kNote table, kDesi, giSkala, 0
kCpsback = cpsoct(kOktav + kNote/12)

kTransp = kCpsback / kCps

;fasevokoderanalysis
ifftsize= 1024 ; Antall samples i FFT, må være faktor av winsize
ioverlap= ifftsize/4 ; Antall samples overlap mellom vindu
iwinsize= 1024 ; Størrelse på vindu. Mange samples-høyere
iwintype= 1 ; Type vindu, 0=hanning, 1=von hann
;
fsig1 pvsanal a1, ifftsize, ioverlap, iwinsize, iwintype
fsig2 pvsanal a1, ifftsize, ioverlap, iwinsize, iwintype

;portamento control idea
;a1,a2 ptrack aout, 512 ; pitch track with winsize=1024
;kcps port a1, 0.01 ; smooth freq

;
fscal1 pvscale fsig1, kTransp
fscal2 pvscale fsig2, kTransp

;
aout1 pvsynth fscal1
aout2 pvsynth fscal2

out aout1, aout2
endin

Read more here: Source link