pvslock

pvslock — Frequency lock an input fsig

Description

This opcode searches for spectral peaks and then locks the frequencies around those peaks. This is similar to phase-locking in non-streaming PV processing. It can be used to improve timestretching and pitch-shifting quality in PV processing.

Syntax

fsig pvslock fsigin, klock

Performance

fsig -- output pv stream

fsigin -- input pv stream.

klock -- frequency lock, 1 -> lock, 0 -> unlock (bypass).

[Warning] Warning

It is unsafe to use the same f-variable for both input and output of pvs opcodes. Using the same one might lead to undefined behavior on some opcodes. Use a different one on the left and right sides of the opcode.

Examples

Here is an example of the pvslock opcode. It uses the file pvslock.csd.

Example 704. Example of the pvslock opcode.

See the sections Real-time Audio and Command Line Flags for more information on using command line flags.

<CsoundSynthesizer>
<CsOptions>
; Select audio/midi flags here according to platform
-odac      ;;;realtime audio out
;-iadc    ;;;uncomment -iadc if realtime audio input is needed too
; For Non-realtime ouput leave only the line below:
; -o pvslock.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
ksmps = 32
nchnls = 2
0dbfs  = 1

gifil ftgen 0, 0, 0, 1, "fox.wav", 0, 0, 1

instr 1

klock	= p4
fsig    pvstanal 1, 1, 1, gifil	; no further transformations		
fsigout	pvslock  fsig, klock	; lock frequency 
aout    pvsynth  fsigout
        outs     aout, aout

endin
</CsInstruments>
<CsScore>
          
i 1 0 2.6 1	; locked
i 1 3 2.6 0	; not locked     

e
</CsScore>
</CsoundSynthesizer>


Credits

Author: Victor Lazzarini
November 2004

New plugin in version 5

November 2004.