aboutsummaryrefslogtreecommitdiff
path: root/BUG3/effects.udo
blob: abfe622010cd5f6c0f4dcc2e0ee05e441d5c304f (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
#ifndef UDO_EFFECTS
#define UDO_EFFECTS ##
/*
	Debugger - Unfixed Bugs : BUG #3

	Audio effects
*/


/*
	A stereo chorus opcode with multiple voices
	By Bhob Rainey

	al, ar ensembleChorus ain, kdelay, kdpth, kminrate, kmaxrate, inumvoice, iwave

	al, ar		audio output
	
	ain 		audio input
	kdelay		delay time in seconds
	kdepth		chorus depth in seconds
	kminrate	min lfo rate cps
	kmaxrate	max lfo rate cps
	inumvoice	number of voices
	iwave		function table for the lfo wave (sine, triangle, etc).
	
*/
opcode ensembleChorus, aa, akkkkiip
	ain, kdelay, kdpth, kmin, kmax, inumvoice, iwave, icount xin
	incr = 1/(inumvoice)

	if (icount == inumvoice) goto out
		ainl, ainr ensembleChorus ain, kdelay, kdpth, kmin, kmax, inumvoice, iwave, icount + 1

out:

max:
	imax = i(kmax)
	if (kmax != imax) then 
		reinit max
	endif

	iratemax unirand imax
	rireturn
	alfo oscil kdpth, iratemax + kmin, iwave
	adel vdelay3 ain/(inumvoice * .5), (kdelay + alfo) * 1000, 1000
	al = ainl + adel * incr * icount
	ar = ainr + adel * (1 - incr * icount)
	xout al, ar
endop



#end