aboutsummaryrefslogtreecommitdiff
path: root/site/udo/fnml/clay_workings.csd
blob: e11e64ba3cdf688d460a2e3954ad1e7634ef6574 (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
<CsoundSynthesizer>
<CsOptions>
-odac
</CsOptions>
<CsInstruments>
sr = 44100
kr = 4410
nchnls = 2
0dbfs = 1
seed 0

#include "sounddb.udo"
#include "uniqueid.udo"
#include "bussing.udo"

gicoll_clay[], gicollclay_id sounddb_getcollection "Clay.Hit"

instr play_clay_roll
	instanceid = uniqueid()
	icollsize = lenarray(gicoll_clay)
	ifreqmax = 100
	kmetrofreq expseg ifreqmax*0.4, p3*0.3, ifreqmax*0.8, p3*0.4, ifreqmax, p4*0.4, ifreqmax*0.5
	kmetro metro kmetrofreq
	if (kmetro == 1) then
		kdbid = gicoll_clay[round:k(random:k(0, icollsize - 1))]
		schedulek "_play_clay_hit", random(0, 1/kmetrofreq), 1, kdbid, instanceid
	endif
	
	kamp expseg 0.001, p3*0.4, 1, p3*0.1, 1, p3*0.4, 0.001

	aL, aR bus_read sprintf("clay_hit%d", instanceid)
	aL pareq aL, 15000, 4, 0.6
	aR pareq aR, 15000, 4, 0.6
	aL *= kamp
	aR *= kamp
	outs aL, aR
endin



instr _play_clay_hit
	idbid = p4
	instanceid = p5
	ifn = gisounddb[idbid][0]
	idur = gisounddb[idbid][2]
	p3 = idur

	aL, aR loscil 0.2, 1, ifn, 1
	ipan = random(0, 1)
	bus_mix(sprintf("clay_hit%d", instanceid), aL*ipan, aR*(1-ipan))
endin


</CsInstruments>
<CsScore>
i"play_clay_roll" 0 6
</CsScore>
</CsoundSynthesizer>