| 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 gen21.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 |
ifn = p4 |
| 19 |
isize = ftlen(ifn) |
| 20 |
prints "TABLE NUMBER: %d\n", ifn |
| 21 |
prints "Index\tValue\n" |
| 22 |
|
| 23 |
iindex = 0 ;start loop |
| 24 |
begin_loop: |
| 25 |
ivalue tab_i iindex, ifn |
| 26 |
prints "%d:\t%f\n", iindex, ivalue |
| 27 |
iindex = iindex + 1 |
| 28 |
if (iindex < isize) igoto begin_loop |
| 29 |
|
| 30 |
;produce sound - and repeat it 10 times so you can hear the patterns: |
| 31 |
aphase phasor 10/10 ;play all 32 values 10x over 10 seconds |
| 32 |
aphase = aphase*isize ;step through table |
| 33 |
afrq table aphase, p4 ;read table number |
| 34 |
asig poscil .5, (afrq*500)+1000,10 ;scale values of table 500 times, add 1000 Hz |
| 35 |
outs asig , asig ;so we can distinguish the different tables |
| 36 |
endin |
| 37 |
|
| 38 |
</CsInstruments> |
| 39 |
<CsScore> |
| 40 |
f1 0 32 21 1 ;Uniform (white noise) |
| 41 |
f2 0 32 21 6 ;Gaussian (mu=0.0, sigma=1/3.83=0.261) |
| 42 |
f3 0 32 21 6 5.745 ;Gaussian (mu=0.0, sigma=5.745/3.83=1.5) |
| 43 |
f4 0 32 21 9 1 1 2 ;Beta (note that level precedes arguments) |
| 44 |
f5 0 32 21 10 1 2 ;Weibull |
| 45 |
f10 0 8192 10 1 ;Sine wave |
| 46 |
|
| 47 |
i 1 0 10 1 |
| 48 |
i 1 11 10 2 |
| 49 |
i 1 22 10 3 |
| 50 |
i 1 33 10 4 |
| 51 |
i 1 44 10 5 |
| 52 |
e |
| 53 |
</CsScore> |
| 54 |
</CsoundSynthesizer> |
| 55 |
|