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?
; 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
;PITCH INFORMATION SPECIFIC TO SAMPLE 1
print iHz1, isamplespeedratio1, ipitchcorrection1, iEstimateSampleBaseHz1 ;PRINT RESULTS
print iHz2, isamplespeedratio2, ipitchcorrection2, iEstimateSampleBaseHz2
;TRANSPOSE FIRST SOLO
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
;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]
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