Debian Codegraph @

examples/lpfreson.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac --limiter=0.95 ;;;realtime audio out, limit loud pops
5 ;-iadc ;;;uncomment -iadc if realtime audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o lpfreson.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 ; by Menno Knevel - 2021
17 ;do not use -a option when analyzing "fox.wav" with lpfreson as
18 ;it needs a filter coefficient type of file
19 ires system_i 1,{{ lpanal -p50 -h200 -P50 -Q15000 -v1 fox.wav fox_coef.lpc }}
20
21 instr 1
22
23 ilen filelen "fox.wav" ; length of soundfile
24 prints "fox.wav = %f seconds\\n",ilen
25 aref diskin "fox.wav", 1 ; don't play this, but use this as an amplitude reference
26
27 ktime line 0, p3, p4
28 krmsr,krmso,kerr,kcps lpread ktime,"fox_coef.lpc"
29 krmso *= .000007 ; scale amplitude
30 asig buzz krmso, kcps, int(sr/2/kcps), 1 ; max harmonics without aliasing
31 aout lpfreson asig, p5 ; Pole file not supported!!
32 abal balance2 aout, aref ; use amplitude of diskin as reference
33 outs abal, abal
34
35 endin
36 </CsInstruments>
37 <CsScore>
38 ; sine
39 f1 0 4096 10 1
40 ; dur ratio
41 i 1 0 2.8 1 1 ; first words
42 i 1 4 2.8 1 .5 ; same, but lower ratio
43 i 1 8 2.8 2.756 1 ; whole sentence
44 i 1 12 2.8 2.756 2 ; same, but higher ratio
45
46 e
47 </CsScore>
48 </CsoundSynthesizer>