| 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 exp.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 |
gisine ftgen 0, 0, 2^10, 10, 1 ;table for a sine wave |
| 17 |
|
| 18 |
instr 1 ;master instrument |
| 19 |
koct linseg 6, p3, 12 ; octave register straight rising from 6 to 12 |
| 20 |
kexp linseg 0, p3/3, 5, p3/3, 5, p3/3, 0 ;exponent goes from 0 to 5 and back |
| 21 |
kdens = exp(kexp) ;density is e to the power of kexp |
| 22 |
printks "Generated events per second: %d\n", 1, kdens |
| 23 |
ktrig metro kdens ;trigger single notes in kdens frequency |
| 24 |
if ktrig == 1 then |
| 25 |
;call instr 10 for 1/kdens duration, .5 amplitude and koct register |
| 26 |
event "i", 10, 0, 1/kdens, .5, koct |
| 27 |
endif |
| 28 |
endin |
| 29 |
|
| 30 |
instr 10 ;performs one tone |
| 31 |
ioct rnd31 1, 0 ;random deviation maximum one octave plus/minus |
| 32 |
aenv transeg p4, p3, -6, 0 ;fast decaying envelope for p4 amplitude |
| 33 |
asin poscil aenv, cpsoct(p5+ioct), gisine ;sine for p5 octave register plus random deviation |
| 34 |
outs asin, asin |
| 35 |
endin |
| 36 |
|
| 37 |
</CsInstruments> |
| 38 |
<CsScore> |
| 39 |
i 1 0 30 |
| 40 |
e |
| 41 |
</CsScore> |
| 42 |
</CsoundSynthesizer> |