added bastis csound files
[supertux.git] / contrib / sounds / csound / sfx.orc
1
2 ; supertux - various sound effect orchestra
3 ;
4 ;  note - The sounds can't be looped right away, an external program needs 
5 ;         to be used to make them loop
6 ;
7 ;        Bastiaan Zapf - freenode.net basti_ 
8
9 sr = 44100
10 kr = 44100
11 ksmps = 1
12 nchnls = 1
13
14 ; lava sound
15
16 instr 1
17   ; Generate a random between 0 and 1.
18   ; krange = 1
19
20         kocrck init 0
21
22         a1 exprand 10             ; exponential noise as a base
23
24         kncrck exprand 1          ; get new crackle raw
25         kcrck = (kocrck-kncrck)/2 ; dc correct crackle
26         kocrck = kncrck           ; remember old crackle
27
28         a1    pareq   a1, p4, 30    , 1 , 1 ; growl
29         a1    pareq   a1, p5, 0     , 1 , 2 ; high stop
30         a1    pareq   a1, p6, kncrck, p7, 0 ; "crackling" of various intensity
31
32         a1    pareq   a1, 10, 0     , 1 , 1 ; thunder stop (dc correction)
33
34         aout  =       a1*750 ; adjust your volume here
35
36         out aout 
37
38 endin
39
40 ; rain / water - this is quite similar to lava, just "crackles" more
41
42 instr 2
43
44         a1 exprand 10
45
46         kocrck init 0
47         kncrck exprand 1 ; get new crackle
48         k2crck = kncrck
49         kncrck = kncrck -1
50         kncrck = kncrck^p8    ; few high values, many low values - how sparse
51                               ; the highs are is controlled by the power (p8).
52         kcrck = (kocrck-kncrck)/2 ; dc correct crackle
53         kocrck = kncrck           ; remember old crackle
54
55         a1    pareq   a1, p4,p5, 1, 1 ; growl
56         a1    pareq   a1, p6  ,1+kncrck*p7 ,1, 0 ; "crackling"
57         a1    pareq   a1, p6/2,1+k2crck*p7 ,1, 0 ; "crackling"
58
59         a1    pareq   a1,  10, 0, 1, 1 ; thunder stop (dc correction)
60         a1    pareq   a1, 4000, 0, 1, 2 ; extreme high stop
61
62         out a1*700 ; adjust your volume here
63 endin
64         
65
66 instr 3
67         ifqc = cpspch(p4)
68
69         kamp linseg 0,p3/4,1,p3/2,1,p3/4,0
70
71         kff  init  1
72
73         aout    oscil3 p5,ifqc*kff,1  ; make a sound
74         aout    butterhp aout,500,0.5 ; ear protection ;)
75
76         kff = kff*p6 ; frequency exponential rise
77         out aout*kamp
78
79 endin