aboutsummaryrefslogtreecommitdiff
path: root/examples/all.csd
blob: a9b9d53d2c912f6c2303c64e6a940a3b75245b85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
nchnls = 2
0dbfs = 1
seed 0

opcode example_source, a, 0
	asig oscil 0.1, abs(oscil(220, 0.7)) + 220
	xout asig
endop

/*
	kdensity = random:k(random:k(0, 1), random:k(0.1, 0.9))
	krepeattrig = abs(oscil(1.5, random:k(3, 14)))
	kbufread = abs(oscil(1, random:k(7, 13)))
	kbufmode = int(random:k(0, 2))
	a1 bitchrandom 1, kdensity, krepeattrig, kbufread, kbufmode
*/

opcode example_bitchrandom, a, 0
	kamp init 0.1
	kdensity init 1
	krepeattrig = abs(oscil(2, 0.4))
	kbufread = abs(oscil(1, random:k(7, 13)))
	kbufmode init 1
	ibufsize = 4410
	aout bitchrandom kamp, kdensity, krepeattrig, kbufread, kbufmode ; [, ibufsize]
	xout aout
endop

opcode example_bitchglitch, a, a
	ain xin
	kread init 0
	kmetro metro 1
	if (kmetro == 1) then
		kread = 1 - kread
	endif
	ksizeratio = abs(oscil(0.5, 2)) + 0.01
	aout bitchglitch ain, kread, ksizeratio
	xout aout
endop

instr bitchrandom
	aout = example_bitchrandom()
	outs aout, aout
endin

instr bitchglitch
	ain = example_source()
	aout = example_bitchglitch(ain)
	outs aout, aout
endin

instr bitchwreck
	ibuffersize = 1
	ain = example_source()
	kwrite init 0
	kmetro metro abs:k(oscil:k(10, 0.7)) + 2
	if (kmetro == 1) then
		kwrite = 1 - kwrite
	endif
	aout bitchwreck ain, ibuffersize, kwrite
	outs aout, aout
endin

instr bitchpan
	ain = example_source()
	ksamples = abs(oscil(20, 0.1)) + 1
	aL, aR bitchpan ain, ksamples
	outs aL, aR
endin

instr bitchaverage
	ain = example_source()
	kratio = abs(oscil(1, 0.5))
	aout bitchaverage ain, kratio, 1024
	outs aout, aout
endin

instr bitchpeaker
	ain = example_source()
	kbufferratio = abs(oscil(1, abs(oscil(20, 0.2))))
	kconsiderationratio = abs(oscil(0.7, 0.9))
	aout bitchpeaker ain, kbufferratio, kconsiderationratio, 128, 512
	outs aout, aout
endin

instr bitchall
	asig = example_bitchrandom()

	asig = example_bitchglitch(asig)

	kbufferratio = abs(oscil(1, abs(oscil(20, 0.2))))
	kconsiderationratio = abs(oscil(0.7, 0.9))

	asig bitchaverage asig, abs:k(oscil:k(1, 1)), 128

	asig bitchpeaker asig, kbufferratio, kconsiderationratio, 128, 512

	aL, aR bitchpan asig, abs:k(oscil:k(abs:k(oscil:k(500, 0.2)) + 40, 1.05)) + 1
	outs aL, aR
endin
</CsInstruments>
<CsScore>
;i"bitchrandom" 0 10
;i"bitchglitch" 0 10
;i"bitchwreck" 0 10
;i"bitchpan" 0 10
;i"bitchaverage" 0 10
;i"bitchpeaker" 0 10
i"bitchall" 0 10
</CsScore>
</CsoundSynthesizer>