Calculation transpositions

Hello,

I'm trying to find out how to define fundamental for pvshift, and not getting the right result. This is part of a much larger instrument, so I will only give the part calculating pitch.

kpitchfactor1 and kpitchfactor2 gives the correct pitch when using pvscale.

kshift1 and kshift2 should give the same fundamental pitch as for pvscale, but I'm not doing it right. The transposition is much too small. I know pitch shifting is different from scaling, but I want to have the correct transposition, and the compressed or expanded spectrum on top of it.

I have to set a base frequency for each soundfile in the score, after listening to the sounds. Is there a way to auto-detect average pitch at i-rate? All methods I have found work at k-rate. And I don't want to cancel out pitch curves already present in the sound.

The range of the vibrato is not easy to control either with this orchestra. Do you have some suggestions?

Best,
Ruben

;(....)

;-___________________________________________________________________________________________________________________________________________________________________________
; CALCULATE PITCH CURVE (for 2 input sounds)
;-___________________________________________________________________________________________________________________________________________________________________________
kpitch expseg ipitch1,p3,ipitch2 ;SCORE PITCHES

ivibrspeed= (ipitch1*ivibrspeed) ;VIBRATO
kvibr poscil3 1,ivibrspeed,1
kvibrenvelope poscil3 1,1/p3, ivibrenvfunc
kvibr=(((kvibr/2)+1)*(ipitch1*ivibrange))*kvibrenvelope
kpitch=kpitch+kvibr
;PITCH INFORMATION SPECIFIC TO SAMPLE 1
ipitchcorrection1=1/isamplespeedratio1
ipitchshiftbase1=ipitchcorrection1
kpitchfactor1=(1*ipitchshiftbase1)*(kpitch/iEstimateSampleBaseHz1)
kshift1=(kpitchfactor1*ipitch1)-ipitch1

ipitchcorrection2=1/isamplespeedratio2
ipitchshiftbase2=ipitchcorrection2
kpitchfactor2=(1*ipitchshiftbase2)*(kpitch/iEstimateSampleBaseHz2)
kshift2=(kpitchfactor2*ipitch1)-ipitch1

print iHz1, isamplespeedratio1, ipitchcorrection1, iEstimateSampleBaseHz1 ;PRINT RESULTS
print iHz2, isamplespeedratio2, ipitchcorrection2, iEstimateSampleBaseHz2

;(....)

;_____________________________________________________________
;TRANSPOSE FIRST SOLO
;_____________________________________________________________
iwannatransposefirstonly:
fsig3 pvscale fsig1, kpitchfactor1, ikeepform, 1
fsig4 pvscale fsig2, kpitchfactor1, ikeepform, 1

if (imethod ==3) goto pvsblurringfirstsolo
if (imethod ==5) goto pvsarpeggiofirstsolo
if (imethod ==7) goto pvsfreezefirstsolo

goto synthesize34

;(....)

;_____________________________________________________________
;PITCHSHIFT FIRST SOLO
;outputpvstream pvshift inputpvstream (different name!), FreqshiftHz(+/-), lowest shiftfreq,
;keep formants (0=not,1=impose orgamp, 2=keep formants by filtering spectral envelope, amplitude scaling (1= no change)
;fsig pvshift fsigin, kshift (shift in Hz), klowest (lowest Hz to be shifted)[, ikeepform(0=no 1=keeporgamp 2=keeporgspec), igain]
;_____________________________________________________________
iwannashiftfirstonly:
fsig3 pvshift fsig1, kshift1, klowestshiftfreq, ikeepform, 1
fsig4 pvshift fsig2, kshift1, klowestshiftfreq, ikeepform, 1

if (imethod ==4) goto pvsblurringfirstsolo
if (imethod ==6) goto pvsarpeggiofirstsolo
if (imethod ==8) goto pvsfreezefirstsolo
goto synthesize34

;(....)

Canadian pharmacy viagra buy viagra uk cheap generic viagra z pak avanafil viagra uk Canadian pharmacy z-pack kamagra uk zpack staxyn pharmacy uk cialis uk ed drugs zpak cialis online viagra online z pack generic viagra generic cialis buy zithromax z-pak ed pills