aboutsummaryrefslogtreecommitdiff
path: root/site/udo/delays.udo
blob: 948e3cbe81f6f37b90eaf58e8210bfc9d2c9d4bc (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
#ifndef UDO_DELAYS
#define UDO_DELAYS ##
/*
	Delay lines

	This file is part of the SONICS UDO collection by Richard Knight 2021
		License: GPL-2.0-or-later
		http://1bpm.net
*/


/*
	Multitap delay with random oscillated repitching and feedback
	aout delay_wild ain, imindelay, imaxdelay

	aout		delayed signal
	ain		input signal
	imindelay	minimum delay time
	imaxdelay	maximum delay time
*/
opcode delay_wild, a, aoo
	ain, imindelay, imaxdelay xin
	if (imindelay == 0) then
		imindelay = 0.2
	endif
	if (imaxdelay == 0) then
		imaxdelay = 0.6
	endif
	adb delayr imaxdelay
	ad1 deltap abs(oscili:k(random:i(imindelay, imaxdelay), random:i(0.01, 0.2)))
	ad2 deltap abs(oscili:k(random:i(imindelay, imaxdelay), random:i(0.01, 0.2)))
	delayw ain + (ad1 * random:i(0.1, 0.3)) + (ad2 * random:i(0.1, 0.3))
	
	adb delayr imaxdelay
	ad3 deltap abs(oscili:k(random:i(imindelay, imaxdelay), random:i(0.01, 0.2)))
	ad4 deltap abs(oscili:k(random:i(imindelay, imaxdelay), random:i(0.01, 0.2)))
	delayw ad2 + (ad3 * random:i(0, 0.3)) + (ad4 * random:i(0, 0.3))
	xout ad3+ad4
endop


#end