Debian Codegraph @

src/Examples/FLOSS Manual Examples/05 Sound Modification/05B03_pan2.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 -odac
4 </CsOptions>
5
6 <CsInstruments>
7 sr = 44100
8 ksmps = 32
9 nchnls = 2
10 0dbfs = 1
11
12 instr 1
13 imethod = p4 ; read panning method variable from score (p4)
14 ;----------------------- generate a source sound ------------------------
15 aSig pinkish 0.1 ; pink noise
16 aSig reson aSig, 500, 30, 2 ; bandpass filtered
17 ;------------------------------------------------------------------------
18
19 ;---------------------------- pan the signal ----------------------------
20 aPan lfo 0.5, 1/2, 1 ; panning controlled by an lfo
21 aPan = aPan + 0.5 ; DC shifted + 0.5
22 aSigL, aSigR pan2 aSig, aPan, imethod; create stereo panned output
23 ;------------------------------------------------------------------------
24
25 outs aSigL, aSigR ; audio sent to outputs
26 endin
27
28 </CsInstruments>
29
30 <CsScore>
31 ; 3 notes one after the other to demonstrate 3 methods used by pan2
32 ;p1 p2 p3 p4
33 i 1 0 4.5 0 ; equal power (harmonic)
34 i 1 5 4.5 1 ; square root method
35 i 1 10 4.5 2 ; linear
36 e
37 </CsScore>
38 </CsoundSynthesizer>
39 ;example by Iain McCurdy