pvspitch

pvspitch — Track the pitch and amplitude of a PVS signal.

Description

Track the pitch and amplitude of a PVS signal as k-rate variables.

Syntax

kfr, kamp pvspitch fsig, kthresh

Performance

kamp -- bin amplitude

kfr -- bin frequency

fsig -- an input pv stream

kthresh -- analysis threshold (between 0 and 1) relative to 0dBfs. Higher values will eliminate low-amplitude components from the analysis.

Examples

Here is an example of the pvspitch opcode. It uses the file pvspitch.csd. This example uses realtime audio input but can be used for audiofile input as well.

Example 311. Example of the pvspitch 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
; Audio out   Audio in
-odac           -iadc    ;;;RT audio I/O
; For Non-realtime ouput leave only the line below:
; -o pvspitch.wav -W ;;; for file output any platform
</CsOptions>
<CsInstruments>

sr = 44100
kr = 4410
ksmps = 10
nchnls = 1

instr 1

ifftsize = 1024
iwtype = 1    /* cleaner with hanning window */

a1 inch 1 ;Realtime audio input
;a1   soundin "input.wav" ;Use this line for file input

fsig pvsanal   a1, ifftsize, ifftsize/4, ifftsize, iwtype
kfr, kamp pvspitch   fsig, 10
adm  oscil     kamp, kfr, 1

       out    adm
endin


</CsInstruments>
<CsScore>

i 1 0 30

e

</CsScore>
</CsoundSynthesizer>

        

Credits

Author: Alan OCinneide
August 2005, added by V Lazzarini, August 2006