| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
-odac ;;;realtime audio out |
| 5 |
;-iadc ;;;uncomment -iadc if realtime audio input is needed too |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o signum2.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
sr = 44100 |
| 12 |
kr = 4410 |
| 13 |
ksmps = 10 |
| 14 |
nchnls = 2 |
| 15 |
0dbfs = 1 |
| 16 |
|
| 17 |
gaArr[] init 2 |
| 18 |
|
| 19 |
instr 1 |
| 20 |
kEnv transeg 1, p3, -3, 0 |
| 21 |
|
| 22 |
a_pi = 4 * taninv(1.0); |
| 23 |
a1 phasor 440; |
| 24 |
a2 = sin(2 * a_pi * 1/ksmps * a1); |
| 25 |
a3 dcblock2 a2 |
| 26 |
asig = signum(a3) |
| 27 |
|
| 28 |
gaArr[0] = a2 * 0.6 * kEnv |
| 29 |
gaArr[1] = asig * 0.6 * kEnv |
| 30 |
|
| 31 |
outs gaArr[0], gaArr[1] |
| 32 |
endin |
| 33 |
|
| 34 |
</CsInstruments> |
| 35 |
<CsScore> |
| 36 |
i 1 0 3 |
| 37 |
|
| 38 |
</CsScore> |
| 39 |
</CsoundSynthesizer> |