Debian Codegraph @

examples/pdhalf.csd

raw
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 pdhalf.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 4
17
18 idur = p3
19 iamp = p4
20 ifreq = p5
21 itable = p6
22
23 aenv linseg 0, .001, 1.0, idur - .051, 1.0, .05, 0
24 aosc phasor ifreq
25 kamount linseg 0.0, 0.02, -0.99, 0.05, -0.9, idur-0.06, 0.0
26 apd pdhalf aosc, kamount
27 aout tablei apd, itable, 1
28
29 outs aenv*aout*iamp, aenv*aout*iamp
30 endin
31
32 </CsInstruments>
33 <CsScore>
34 f1 0 16385 10 1
35 f2 0 16385 10 1 .5 .3333 .25 .5
36 f3 0 16385 9 1 1 270 ; inverted cosine
37
38 ; descending "just blues" scale
39
40 ; pdhalf with cosine table
41 ; (imitates the CZ-101 "sawtooth waveform")
42 t 0 100
43 i4 0 3 .6 512 3
44 i. + . . 448
45 i. + . . 384
46 i. + . . 358.4
47 i. + . . 341.33
48 i. + . . 298.67
49 i. + 5 . 256
50 s
51 ; pdhalf with a sine table
52 t 0 120
53 i4 0 3 .6 512 1
54 i. + . . 448
55 i. + . . 384
56 i. + . . 358.4
57 i. + . . 341.33
58 i. + . . 298.67
59 i. + 5 . 256
60 s
61 ; pdhalf with a sawtooth-like table
62 t 0 150
63 i4 0 3 .6 512 2
64 i. + . . 448
65 i. + . . 384
66 i. + . . 358.4
67 i. + . . 341.33
68 i. + . . 298.67
69 i. + 5 . 256
70 e
71 </CsScore>
72 </CsoundSynthesizer>