-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path3-mix
More file actions
55 lines (45 loc) · 992 Bytes
/
Copy path3-mix
File metadata and controls
55 lines (45 loc) · 992 Bytes
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
desc:3-channel to stereo mixer 1,2 is L,R. 3 is Center. 4 is spot.
in_pin:Left
in_pin:Right
in_pin:Center
in_pin:Spot
out_pin:Left
out_pin:Right
slider1:-6<-90,10,1>Stereo-LR
slider2:-6<-90,10,1>Center
slider3:-90<-90,10,1>Spot
slider4:0<-12,12,0.1>Crossfade LR <-> Center
@init
bpos=0;
@slider
stereolevel = 10^(slider1/20);
centerlevel = 10^(slider2/20);
spotlevel = 10^(slider3/20);
//Borrowed crossfade:
slider4 < -40 ? slider4 = -40;
slider4 > 40 ? slider4 = 40;
mixPercent = slider4;
mixPercent == 40 ? mixPercent = 100;
mixPercent == -40 ? mixPercent = -100;
slider4 <= 0 ?
(
crossT1 = 1;
crossT2 = 2 ^ ( mixPercent/ 6 );
) :
(
crossT1 = 2 ^ ( -mixPercent / 6 );
crossT2 = 1;
);
@block
blah+=samplesblock;
@sample
//inputs
inL = spl0;
inR = spl1;
inC = spl2;
inSpot = spl3;
//output
spl0 = (inL*stereolevel*crossT1) + (inC*centerlevel*crossT2) + (inSpot*spotlevel);
spl1 = (inR*stereolevel*crossT1) + (inC*centerlevel*crossT2) + (inSpot*spotlevel);
spl2 = null;
spl3 = null;