Pvshift

Hello everybody,

another question to Joachim who is the father of this opcode. The first three parameters of Pvshift are supposed to be k-parameters.
I set a simple control using line, to dynamically shift the lowest frequency of the spectrum
But I can’t notice any shifting. Did I make something wrong?

-odac

sr = 96000
ksmps = 256
nchnls = 2
0dbfs = 1

instr 1
ilowesta = p4
ilowestb = p5
ishift = p6
ikeepform = p7; 0=no formant keeping, 1=keep by amps, 2=keep by spectral envelope

klowest line ilowesta, 20, ilowestb

asig1, asig2 soundin “Mi_03_CTS3_CrCl03_08.aif”
fsig1 pvsanal asig1, 8192, 256, 8192, 1 ; analyse it
fshift1 pvshift fsig1, ishift, klowest, ikeepform; shift frequencies
aout1 pvsynth fshift1; resynthesize

;asig2 soundin “Ponte_traghetto_3_raw_Sel_raw_01_CTS10-R.aif”
fsig2 pvsanal asig2, 8192, 256, 8192, 1 ; analyse it
fshift2 pvshift fsig2, ishift, klowest, ikeepform; shift frequencies
aout2 pvsynth fshift2; resynthesize

	 outs aout1, aout2

endin

i1 0 20 50 1000 50 0 e

I know you asked Joaquim, but in the meantime this may help.

I’m not sure exactly what result you intend to achieve, but without the soundfile (aif) it’s hard to discuss specifics.

The ishift value you have is relatively low, especially when it changes over a duration of 20 seconds, so depending on the soundfile may not be very audible.

Here, with a the ishift value changed to 500, the shifting is pretty obvious:

<CsoundSynthesizer>
<CsOptions>
 -odac
 -o pvshift.wav
</CsOptions>
;==================================
<CsInstruments>

sr = 96000
ksmps = 256
nchnls = 2
0dbfs = 1

instr 1
ilowesta = p4
ilowestb = p5
ishift = p6
ikeepform = p7; 0=no formant keeping, 1=keep by amps, 2=keep by spectral envelope

klowest line ilowesta, 19.4, ilowestb

asig1 diskin2 "fox.wav", 1, 0, 1
fsig1 pvsanal asig1, 8192, 256, 8192, 1 ; analyse it
fshift1 pvshift fsig1, ishift, klowest, ikeepform; shift frequencies
aout1 pvsynth fshift1; resynthesize

	 outs aout1, aout1
endin

</CsInstruments>
;==================================
<CsScore>

i1 0 19.4 50 1000 500 0
e

</CsScore>
</CsoundSynthesizer>

Best,
Scott

oops? just to note that the author of the opcode is (as of nearly all
the pvs opcodes) victor lazzarini. this is also mentioned at
https://csound.com/docs/manual/pvshift.html