Debian Codegraph @

examples/diskgrain.csd

raw
1 <CsoundSynthesizer>
2 <CsOptions>
3 ; Select audio/midi flags here according to platform
4 -odac ;;;RT audio out
5 ;-iadc ;;;uncomment -iadc if RT audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o diskgrain.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 ; additions by Menno Knevel 2022
12
13 sr = 44100
14 ksmps = 32
15 nchnls = 2
16 0dbfs = 1
17
18 instr 1
19
20 iolaps = 2
21 igrsize = 0.04
22 ifreq = iolaps/igrsize
23 ips = 1/iolaps
24
25 istr = p4 /* timescale */
26 ipitch = p5 /* pitchscale */
27
28 a1 diskgrain "marimba.aif", 1, ifreq, ipitch, igrsize, ips*istr, 1, iolaps
29 prints "\nmarimba is playing....\n\n"
30 outs a1, a1
31
32 endin
33
34 instr 2
35
36 iolaps = 5
37 igrsize = 0.1
38 ifreq = iolaps/igrsize
39 ips = 1/iolaps
40
41 istr = p4 /* timescale */
42 ipitch = p5 /* pitchscale */
43
44 a1 diskgrain "singFemale.aif", .5, ifreq, ipitch, igrsize, ips*istr, 1, iolaps
45 prints "\nFemale is singing....\n\n"
46 outs a1, a1
47
48 endin
49
50 </CsInstruments>
51 <CsScore>
52 f 1 0 8192 20 2 1 ;Hanning function
53
54 ; timescale pitchscale
55 i 1 0 6 1 1
56 i 1 + 6 2 1
57 i 1 + 6 1 0.75
58 i 1 + 6 1.5 1.5
59 i 1 + 6.25 0.5 1.5
60
61 ; timescale pitchscale
62 i 2 31 4 1 1
63 i 2 + 4 2 1
64 i 2 + 4 1 0.75
65 i 2 + 5 1.5 1.5
66 i 2 + 7.9 0.5 1.5
67 e
68 </CsScore>
69 </CsoundSynthesizer>