Debian Codegraph @

examples/pvshift.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o pvshift.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 nchnls = 2
14 0dbfs = 1
15
16 ;; example written by joachim heintz 2009
17
18 instr 1
19 ishift = p4 ; shift amount in Hz
20 ilowest = p5 ; lowest frequency to be shifted
21 ikeepform = p6 ; 0=no formant keeping, 1=keep by amps, 2=keep by spectral envelope
22 ifftsize = 1024
23 ioverlap = ifftsize / 4
24 iwinsize = ifftsize
25 iwinshape = 1 ; von-Hann window
26 Sfile = "fox.wav"
27 ain soundin Sfile
28 fftin pvsanal ain, ifftsize, ioverlap, iwinsize, iwinshape; fft-analysis of file
29 fshift pvshift fftin, ishift, ilowest, ikeepform; shift frequencies
30 aout pvsynth fshift; resynthesize
31 outs aout, aout
32 endin
33
34 </CsInstruments>
35 <CsScore>
36 i 1 0 2.757 0 0 0; no shift at all
37 i 1 3 2.757 100 0 0; shift all frequencies by 100 Hz
38 i 1 6 2.757 200 0 0; by 200 Hz
39 i 1 9 2.757 200 0 1; keep formants by method 1
40 i 1 12 2.757 200 0 2; by method 2
41 i 1 15 2.757 200 1000 0; shift by 200 Hz but just above 1000 Hz
42 i 1 18 2.757 1000 500 0; shift by 1000 Hz above 500 Hz
43 i 1 21 2.757 1000 300 0; above 300 Hz
44 e
45 </CsScore>
46 </CsoundSynthesizer>