Debian Codegraph @

examples/st2ms.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 RT audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o st2ms.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 ; sample = ambient sound of waterfall + animals (monkey)
18
19 instr 1
20 al, ar diskin2 "stereoJungle.wav", 1 ; stereo sample
21 am, as st2ms al,ar
22 fout "MSJungleEncoded.wav", -1, am *.6, as *.6 ; write MS encoded audio file to disk
23 outs am *.6, as *.6 ; & reduce volume a bit
24
25 endin
26
27 instr 2
28 al, ar diskin2 "MSJungleEncoded.wav", 1 ; get back in the MS encoded sample
29 am, as ms2st al,ar, p4
30 outs am, as
31
32 endin
33
34 </CsInstruments>
35 <CsScore>
36
37 i1 0 6.7 ; encode signal, write to disk
38
39 i2 10 6.7 .5 ; read encoded file from disk and decode 1:1
40 i2 17 6.7 .7 ; decode but with more width
41
42 e
43 </CsScore>
44 </CsoundSynthesizer>