aboutsummaryrefslogtreecommitdiff
path: root/BUG5/bussing.udo
blob: 78755cef70b40e45d83eccd2dbf2dcd2cfe32193 (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
#ifndef UDO_BUSSING
#define UDO_BUSSING ##


/*
	Get the stereo L and R names for a singular bus name
	
	SnameL, SnameR bus_name Sbus

	SnameL		left bus identifier
	SnameR		right bus identifier

	Sbus		bus name
*/
opcode bus_name, SS, S
	Sbus xin
	xout sprintf("%sL", Sbus), sprintf("%sR", Sbus)
endop


/*
	Mix to a stereo bus

	bus_mix Sbus, aL, aR

	Sbus	bus name
	aL	left channel
	aR	right channel
*/
opcode bus_mix, 0, Saa
	Sbus, aL, aR xin
	SbusL, SbusR bus_name Sbus
	chnmix aL, SbusL
	chnmix aR, SbusR
endop



/*
	Read from a stereo bus, and then clear the bus
	
	aL, aR bus_read Sbus

	aL	left channel
	aR	right channel

	Sbus	bus name
*/
opcode bus_read, aa, S
	Sbus xin
	SbusL, SbusR bus_name Sbus
	aL chnget SbusL
	aR chnget SbusR
	chnclear SbusL
	chnclear SbusR
	xout aL, aR
endop




#end