Debian Codegraph @

examples/pwd.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;realtime audio out
5 ; For Non-realtime ouput leave only the line below:
6 ; -o pwd.wav -W ;;; for file output any platform
7 </CsOptions>
8 <CsInstruments>
9
10 ; by tgrey - 2020
11
12 sr = 44100
13 ksmps = 32
14 nchnls = 2
15 0dbfs = 1
16
17 seed 0 ;each time different seed
18
19 instr 1
20 ;;get the working directory name
21 Spwd pwd
22
23 ;;generating a different filename each time csound renders
24 itim date
25 Stim dates itim
26 Syear strsub Stim, 20, 24
27 Smonth strsub Stim, 4, 7
28 Sday strsub Stim, 8, 10
29 iday strtod Sday
30 Shor strsub Stim, 11, 13
31 Smin strsub Stim, 14, 16
32 Ssec strsub Stim, 17, 19
33 Sfilnam sprintf "%s_%s_%02d_%s_%s_%s.wav", Syear, Smonth, iday, Shor,Smin, Ssec
34 ;;rendering with random frequency, amp and pan, and writing to disk
35 ifreq random 400, 1000
36 iamp random .1, 1
37 ipan random 0, 1
38 asin oscils iamp, ifreq, 0
39 aL, aR pan2 asin, ipan
40 fout Sfilnam, 14, aL, aR
41 outs aL, aR
42 printf_i "File '%s' written to '%s'!\n", 1, Sfilnam, Spwd
43
44 endin
45
46 </CsInstruments>
47 <CsScore>
48 i 1 0 1
49 </CsScore>
50 </CsoundSynthesizer>