| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in No messages |
| 5 |
-odac -iadc -d ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o mpulse.wav -W ;;; for file output any platform |
| 8 |
</CsOptions> |
| 9 |
<CsInstruments> |
| 10 |
|
| 11 |
; Initialize the global variables. |
| 12 |
sr = 44100 |
| 13 |
kr = 4410 |
| 14 |
ksmps = 10 |
| 15 |
nchnls = 1 |
| 16 |
|
| 17 |
gkfreq init 0.1 |
| 18 |
|
| 19 |
instr 1 |
| 20 |
kamp = 10000 |
| 21 |
|
| 22 |
a1 mpulse kamp, gkfreq |
| 23 |
out a1 |
| 24 |
endin |
| 25 |
|
| 26 |
instr 2 |
| 27 |
; Assign the value of p4 to gkfreq |
| 28 |
gkfreq init p4 |
| 29 |
endin |
| 30 |
</CsInstruments> |
| 31 |
<CsScore> |
| 32 |
|
| 33 |
; Play Instrument #1 for one second. |
| 34 |
i 1 0 11 |
| 35 |
i 2 2 1 0.05 |
| 36 |
i 2 4 1 0.01 |
| 37 |
i 2 6 1 0.005 |
| 38 |
; only last notes are audible |
| 39 |
i 2 8 1 0.003 |
| 40 |
i 2 10 1 0.002 |
| 41 |
|
| 42 |
|
| 43 |
e |
| 44 |
|
| 45 |
|
| 46 |
</CsScore> |
| 47 |
</CsoundSynthesizer> |