| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
-odac -m0 |
| 4 |
</CsOptions> |
| 5 |
<CsInstruments> |
| 6 |
sr = 44100 |
| 7 |
ksmps = 32 |
| 8 |
nchnls = 2 |
| 9 |
0dbfs = 1 |
| 10 |
|
| 11 |
instr 1 |
| 12 |
prints "Playing %d Hertz!\n", p4 |
| 13 |
asig poscil .2, p4 |
| 14 |
aout linen asig, 0, p3, p3 |
| 15 |
outs aout, aout |
| 16 |
endin |
| 17 |
|
| 18 |
instr 2 |
| 19 |
prints "Adding %d Hertz to %d Hertz!\n", p5, p4 |
| 20 |
asig poscil .2, p4+p5 |
| 21 |
aout linen asig, 0, p3, p3 |
| 22 |
outs aout, aout |
| 23 |
endin |
| 24 |
|
| 25 |
instr 3 |
| 26 |
prints "Applying the ratio of %f (adding %d Hertz) to %d Hertz!\n", |
| 27 |
p5, p4*p5, p4 |
| 28 |
asig poscil .2, p4*p5 |
| 29 |
aout linen asig, 0, p3, p3 |
| 30 |
outs aout, aout |
| 31 |
endin |
| 32 |
|
| 33 |
</CsInstruments> |
| 34 |
<CsScore> |
| 35 |
;adding a certain frequency (instr 2) |
| 36 |
i 1 0 1 100 |
| 37 |
i 2 1 1 100 100 |
| 38 |
i 1 3 1 400 |
| 39 |
i 2 4 1 400 100 |
| 40 |
i 1 6 1 800 |
| 41 |
i 2 7 1 800 100 |
| 42 |
;applying a certain ratio (instr 3) |
| 43 |
i 1 10 1 100 |
| 44 |
i 3 11 1 100 [3/2] |
| 45 |
i 1 13 1 400 |
| 46 |
i 3 14 1 400 [3/2] |
| 47 |
i 1 16 1 800 |
| 48 |
i 3 17 1 800 [3/2] |
| 49 |
</CsScore> |
| 50 |
</CsoundSynthesizer> |
| 51 |
;example by joachim heintz |