| 1 |
<CsoundSynthesizer> |
| 2 |
<CsOptions> |
| 3 |
; Select audio/midi flags here according to platform |
| 4 |
; Audio out Audio in |
| 5 |
-odac -iadc ;;;RT audio I/O |
| 6 |
; For Non-realtime ouput leave only the line below: |
| 7 |
; -o readk.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 |
0dbfs = 1 |
| 18 |
; By Andres Cabrera 2008 |
| 19 |
|
| 20 |
instr 1 |
| 21 |
; Read a number from the file every 0.5 seconds |
| 22 |
kfibo readk "fibonacci.txt", 7, 0.5 |
| 23 |
kpitchclass = 8 + ((kfibo % 12)/100) |
| 24 |
printk2 kpitchclass |
| 25 |
kcps = cpspch( kpitchclass ) |
| 26 |
printk2 kcps |
| 27 |
a1 oscil 0.5, kcps, 1 |
| 28 |
out a1 |
| 29 |
endin |
| 30 |
|
| 31 |
|
| 32 |
</CsInstruments> |
| 33 |
<CsScore> |
| 34 |
f 1 0 1024 10 1 |
| 35 |
i 1 0 10 |
| 36 |
e |
| 37 |
|
| 38 |
|
| 39 |
</CsScore> |
| 40 |
</CsoundSynthesizer> |