| 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 dates.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 |
seed 0 ;each time different seed |
| 17 |
|
| 18 |
instr 1 |
| 19 |
;;generating a different filename each time csound renders |
| 20 |
itim date |
| 21 |
Stim dates itim |
| 22 |
Syear strsub Stim, 20, 24 |
| 23 |
Smonth strsub Stim, 4, 7 |
| 24 |
Sday strsub Stim, 8, 10 |
| 25 |
iday strtod Sday |
| 26 |
Shor strsub Stim, 11, 13 |
| 27 |
Smin strsub Stim, 14, 16 |
| 28 |
Ssec strsub Stim, 17, 19 |
| 29 |
Sfilnam sprintf "%s_%s_%02d_%s_%s_%s.wav", Syear, Smonth, iday, Shor,Smin, Ssec |
| 30 |
;;rendering with random frequency, amp and pan, and writing to disk |
| 31 |
ifreq random 400, 1000 |
| 32 |
iamp random .1, 1 |
| 33 |
ipan random 0, 1 |
| 34 |
asin oscils iamp, ifreq, 0 |
| 35 |
aL, aR pan2 asin, ipan |
| 36 |
fout Sfilnam, 14, aL, aR |
| 37 |
outs aL, aR |
| 38 |
printf_i "File '%s' written to the same directory as this CSD file is!\n", 1, Sfilnam |
| 39 |
|
| 40 |
endin |
| 41 |
|
| 42 |
</CsInstruments> |
| 43 |
<CsScore> |
| 44 |
i 1 0 1 |
| 45 |
</CsScore> |
| 46 |
</CsoundSynthesizer> |