Debian Codegraph @

examples/partikkel.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 real audio input is needed too
6 ; For Non-realtime ouput leave only the line below:
7 ; -o partikkel.wav -W ;;; for file output any platform
8 </CsOptions>
9 <CsInstruments>
10
11 sr = 44100
12 ksmps = 20
13 nchnls = 2
14
15 giSine ftgen 0, 0, 65537, 10, 1
16 giCosine ftgen 0, 0, 8193, 9, 1, 1, 90
17
18 instr 1
19
20 kgrainfreq = 200 ; 4 grains per second
21 kdistribution = 0 ; periodic grain distribution
22 idisttab = -1 ; (default) flat distribution used for grain distribution
23 async = 0 ; no sync input
24 kenv2amt = 0 ; no secondary enveloping
25 ienv2tab = -1 ; default secondary envelope (flat)
26 ienv_attack = -1 ; ; default attack envelope (flat)
27 ienv_decay = -1 ; ; default decay envelope (flat)
28 ksustain_amount = 0.5 ; time (in fraction of grain dur) at sustain level for each grain
29 ka_d_ratio = 0.5 ; balance between attack and decay time
30 kduration = (0.5/kgrainfreq)*1000 ; set grain duration relative to grain rate
31 kamp = 5000 ; amp
32 igainmasks = -1 ; (default) no gain masking
33 kwavfreq = 440 ; fundamental frequency of source waveform
34 ksweepshape = 0 ; shape of frequency sweep (0=no sweep)
35 iwavfreqstarttab = -1 ; default frequency sweep start (value in table = 1, which give no frequency modification)
36 iwavfreqendtab = -1 ; default frequency sweep end (value in table = 1, which give no frequency modification)
37 awavfm = 0 ; no FM input
38 ifmamptab = -1 ; default FM scaling (=1)
39 kfmenv = -1 ; default FM envelope (flat)
40 icosine = giCosine ; cosine ftable
41 kTrainCps = kgrainfreq ; set trainlet cps equal to grain rate for single-cycle trainlet in each grain
42 knumpartials = 3 ; number of partials in trainlet
43 kchroma = 1 ; balance of partials in trainlet
44 ichannelmasks = -1 ; (default) no channel masking, all grains to output 1
45 krandommask = 0 ; no random grain masking
46 kwaveform1 = giSine ; source waveforms
47 kwaveform2 = giSine ;
48 kwaveform3 = giSine ;
49 kwaveform4 = giSine ;
50 iwaveamptab = -1 ; (default) equal mix of all 4 sourcve waveforms and no amp for trainlets
51 asamplepos1 = 0 ; phase offset for reading source waveform
52 asamplepos2 = 0 ;
53 asamplepos3 = 0 ;
54 asamplepos4 = 0 ;
55 kwavekey1 = 1 ; original key for source waveform
56 kwavekey2 = 1 ;
57 kwavekey3 = 1 ;
58 kwavekey4 = 1 ;
59 imax_grains = 100 ; max grains per k period
60
61 asig partikkel kgrainfreq, kdistribution, idisttab, async, kenv2amt, ienv2tab, \
62 ienv_attack, ienv_decay, ksustain_amount, ka_d_ratio, kduration, kamp, igainmasks, \
63 kwavfreq, ksweepshape, iwavfreqstarttab, iwavfreqendtab, awavfm, \
64 ifmamptab, kfmenv, icosine, kTrainCps, knumpartials, \
65 kchroma, ichannelmasks, krandommask, kwaveform1, kwaveform2, kwaveform3, kwaveform4, \
66 iwaveamptab, asamplepos1, asamplepos2, asamplepos3, asamplepos4, \
67 kwavekey1, kwavekey2, kwavekey3, kwavekey4, imax_grains
68
69 outs asig, asig
70 endin
71
72 </CsInstruments>
73 <CsScore>
74 i1 0 5 ; partikkel
75 e
76 </CsScore>
77 </CsoundSynthesizer>