Debian Codegraph @

examples/pvadd.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac -m0 --limiter=.95 ;;;realtime audio out, with limiter protection
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o pvadd.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 32
13 0dbfs = 1
14 nchnls = 2
15
16 ; by Menno Knevel 2021
17
18 gilen filelen "fox.wav" ; get length of impulse soundfile
19
20 ; analyze sound file and output result to pvoc-ex file
21 ires system_i 1,{{ pvanal fox.wav fox1.pvx }} ; default settings
22
23 instr 1 ; untreated signal
24 asig diskin2 "fox.wav", 1
25 prints "\n---***YOU NOW HEAR THE UNTREATED SOUND SAMPLE***---\n"
26 outs asig, asig
27 endin
28
29 instr 2
30 prints "\n---***YOU NOW HEAR THE RESULT OF THIS ANALYZED FILE:***---\n"
31 ibins = p4
32 igatefn = p5
33 ktime line 0, p3, p3
34 asig pvadd ktime, 1, "fox1.pvx", 1, ibins, 0, 1, 0, 0, igatefn
35 outs asig*.7, asig*.7
36 endin
37
38 </CsInstruments>
39 <CsScore>
40 f 1 0 16384 10 1 ; sine wave
41 f 2 0 512 7 1 512 1 ; 3 different tables for scaling of the gate
42 f 3 0 512 5 1 256 .001
43 f 4 0 512 7 0 256 1 256 1
44
45
46 i1 0 2.76 ; original sample
47 s
48 ; bins table
49 i2 0 2.76 300 2 ; lots of bins & table 2 scales amplitudes (= no change)
50 i2 3 2.76 300 3 ; table 3 scales amplitudes
51 i2 6 2.76 300 4 ; table 4 scales amplitudes
52 s
53 ; bins table
54 i2 0 2.76 30 2 ; a few bins & table 2 scales amplitudes (= no change)
55 i2 3 2.76 30 3 ; table 3 scales amplitudes
56 i2 6 2.76 30 4 ; table 4 scales amplitudes
57 e
58 </CsScore>
59 </CsoundSynthesizer>