Debian Codegraph @

examples/seqtime.csd

raw
1 <CsoundSynthesizer>
2
3 <CsOptions>
4 ; Select audio/midi flags here according to platform
5 ; Audio out Audio in
6 -odac -iadc ;;;RT audio I/O
7 ; For Non-realtime ouput leave only the line below:
8 ; -o seqtime.wav -W ;;; for file output any platform
9 </CsOptions>
10
11 <CsInstruments>
12
13 sr = 44100
14 ksmps = 64
15 nchnls = 1
16
17 ; By Tim Mortimer and Andres Cabrera 2007
18
19 0dbfs = 1
20
21 gisine ftgen 0, 0, 8192, 10, 1
22 ;;; table defining an integer pitch set
23 gipset ftgen 0, 0, 4, -2, 8.00, 8.04, 8.07, 8.10
24 ;;;DELTA times for seqtime
25 gidelta ftgen 0, 0, 4, -2, .5, 1, .25, 1.25
26
27
28 instr 1
29
30 kndx init 0
31 ktrigger init 0
32
33 ktime_unit init 1
34 kstart init p4
35 kloop init p5
36 kinitndx init 0
37 kfn_times init gidelta
38
39 ktrigger seqtime ktime_unit, kstart, kloop, kinitndx, kfn_times
40
41 printk2 ktrigger
42
43
44 if (ktrigger > 0) then
45 kpitch table kndx, gipset
46 event "i", 2, 0, 1, kpitch
47 kndx = kndx + 1
48 kndx = kndx % kloop
49 endif
50
51 endin
52
53
54 instr 2
55 icps = cpspch (p4)
56 a1 buzz 1, icps, 7, gisine
57 aamp expseg 0.00003,.02,1,p3-.02,0.00003
58
59 a1 = a1 * aamp * 0.5
60
61 out a1
62 endin
63
64 </CsInstruments>
65
66 <CsScore>
67 ; start dur kstart kloop
68 i 1 0 7 0 4
69 i 1 8 10 0 3
70 i 1 19 10 4 4
71
72 </CsScore>
73
74 </CsoundSynthesizer>