Debian Codegraph @

examples/vpow-2.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 vpow-2.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 instr 1
17
18 ain diskin2 "fox.wav", 1 ;soundfile
19 fsrc pvsanal ain, 1024, 256, 1024, 1
20 ifn ftgen 0, 0, 1024/2, 2, 0 ;create empty function table for the 513 bins
21 kflag pvsftw fsrc,ifn ;export only amplitudes to table
22 kval line .001, p3, 1 ;start with big distortion, cahnge over note duration to clean sound
23 kbin line p4, p3, p5 ;vary the bins
24 vpow ifn, kval, kbin, 0 ;note that this operation is applied each k-cycle!
25 ;vpow ifn, kval, kbin, 10 ;if you set kdstoffset to 10 it will affect bins 10+(kbin line p4, p3, p5)
26 pvsftr fsrc,ifn ;read modified data back to fsrc
27 aout pvsynth fsrc ;and resynth
28 outs aout*p6, aout*p6 ;adjust volume to compensate
29
30 endin
31 </CsInstruments>
32 <CsScore>
33
34 i 1 0 4 100 100 .02 ;first 100 bins are affected
35 i 1 + 4 10 10 .1 ;first 10 bins
36 i 1 + 4 1 400 .05 ;sweep from bin 1 to 400
37 e
38 </CsScore>
39 </CsoundSynthesizer>