Debian Codegraph @

examples/pvsftr.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 pvsftr.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 gifil ftgen 0, 0, 0, -1, "fox.wav", 0, 0, 1
17
18 instr 1
19
20 ifftsize = 1024 ;fft size
21 ioverlap = 256 ;overlap
22 knewamp = 0 ;new value for amplitudes
23
24 ;create fsig stream from function table
25 fsrc pvstanal 1, 1, 1, gifil, 0, 0, 0, ifftsize, ioverlap, 0
26 ifn ftgen 0, 0, ifftsize/2, 2, 0 ;create empty function table
27 kflag pvsftw fsrc,ifn ;export amps to table
28 ;overwrite the first 10 bins each time the table has been filled new
29 if kflag == 1 then
30 kndx = 0
31 kmaxbin = p4
32 loop:
33 tablew knewamp, kndx, ifn
34 loop_le kndx, 1, kmaxbin, loop
35 endif
36 pvsftr fsrc,ifn ;read modified data back to fsrc
37 aout pvsynth fsrc ;and resynth
38 outs aout, aout
39
40 endin
41 </CsInstruments>
42 <CsScore>
43 ; maxbins
44 i 1 0 4 10
45 i 1 4 4 100
46 e
47 </CsScore>
48 </CsoundSynthesizer>