| 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 timout.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 |
instr 1 |
| 17 |
|
| 18 |
indx = 0 |
| 19 |
itim = p4 ;change time for one step |
| 20 |
|
| 21 |
clock: |
| 22 |
timout 0, itim, time |
| 23 |
reinit clock |
| 24 |
|
| 25 |
time: |
| 26 |
itmp table indx, 2, 0, 0, 1 |
| 27 |
if itmp == 1 then |
| 28 |
print itmp |
| 29 |
event_i "i",2, 0, .1 ;event has duration of .1 second |
| 30 |
endif |
| 31 |
indx = indx+1 |
| 32 |
|
| 33 |
endin |
| 34 |
|
| 35 |
instr 2 ;play it |
| 36 |
|
| 37 |
kenv transeg 0.01, p3*0.25, 1, 1, p3*0.75, .5, 0.01 |
| 38 |
asig oscili kenv*.4, 400, 1 |
| 39 |
outs asig, asig |
| 40 |
|
| 41 |
endin |
| 42 |
</CsInstruments> |
| 43 |
<CsScore> |
| 44 |
f 1 0 1024 10 1 ;sine |
| 45 |
f 2 0 16 2 1 0 0 1 0 1 0 1 0 1 0 0 0 0 0 0 ;the rythm table |
| 46 |
|
| 47 |
i1 0 10 .1 |
| 48 |
i1 + 10 .05 |
| 49 |
i1 + 10 .01 |
| 50 |
e |
| 51 |
</CsScore> |
| 52 |
</CsoundSynthesizer> |