Skip to content

Commit

Permalink
2>5 V2 upmix now unity, 5>7 V3 upmix now has 150% crossover
Browse files Browse the repository at this point in the history
  • Loading branch information
junh1024 committed Apr 10, 2024
1 parent 2b92107 commit 00b2d96
Show file tree
Hide file tree
Showing 5 changed files with 39 additions and 19 deletions.
11 changes: 6 additions & 5 deletions Converters/2.0 to 5.0 Upmix V2 (L).txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ desc:

slider1:0<0,100,2>Width
slider2:100<-100,100,2>Depth
slider3:1<0,1,{Reverse (Narrow), Normal (Wide)}>Polarity of SR (Rear width)
slider3:1<0,1,{Reverse (Narrow),Normal (Wide)}>Polarity of SR (Rear width)
slider4:15000<5000,15000,500>Rear LP (Hz, 15k=off)
slider5:0<0,100,1>Rear Delay (ms)
slider6:0<0,1,0.01>Pan
Expand Down Expand Up @@ -71,8 +71,9 @@ count+=samplesblock;

@sample

mid = 0.5*(spl0+spl1);
side= 0.5*(spl0-spl1);
//changed from 0.5 to 0.7171 in 2024
mid = 0.7071*(spl0+spl1);
side= 0.7071*(spl0-spl1);

//collect stats
Mid_abs =mid*sign(mid) ; //get magnitude
Expand All @@ -83,7 +84,7 @@ sumSide+=Side_abs;

spl0 = (0.7071*mid*(slider6)) + (side*0.2);
spl1 = (0.7071*mid*(slider6)) - (side*0.2);
spl2=mid*1.414*(1-slider6);
spl2=mid*1*(1-slider6); //changed from 1.41 to 1.00 in 2024

spl4 = 0.5071*side; //preupscale

Expand All @@ -100,7 +101,7 @@ slider4<15000?
delaylen>0?
(
out2 = buf3_org[pos2] ;
buf3_org[pos2] = spl4;
buf3_org[pos2] = spl4;
spl4=out2;
pos2=(pos2+1)%(delaylen);
);
Expand Down
2 changes: 1 addition & 1 deletion Converters/5.1 to 7.1 Upmix V2 (M).txt
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ response=slider5;
@sample


MidSide_stats_collect(4);
MidSide_stats_collect(4,5);

//Reversed order is important
spl6 = side_coeff*spl4;
Expand Down
28 changes: 23 additions & 5 deletions Converters/5.1 to 7.1 Upmix V3 (L).txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ desc: 5.1 to 7.1 FFT upmix. in BETA

slider1:1<0,1,1{Square (Cine-auto thresholds),Circle (ITU),Circle+ (ITU)}>Mode
slider2:100<0,200,1>Amount (%)
slider3:50<0,100,1>Side threshold
slider4:100<0,100,1>Crossover width
slider5:75<0,100,1>Cutoff (%)
slider3:50<0,100,1>Side threshold (66=even power)
slider4:100<0,150,1>Crossover width and diffusion (%)
slider5:75<0,100,1>Frequency Cutoff (%)
slider6:50<0,100,2>Time Response
slider7:25<0,50,5>FFT Overlap (%)
slider7:25<0,50,5>FFT Overlap (disabled)
slider8:12<10,14,1>FFT size (pow2)

import surroundlib2.txt
Expand Down Expand Up @@ -44,7 +44,11 @@ out0=out1=out4=out5=0;
@slider

Side_threshold= slider3/100;
Crossover_width=max(slider4/100,0.1);//min of 0.1 since don't want an infinite slope/div 0


slider4=min(max(0, slider4),200);
Crossover_width=min(max(slider4/100,0.1),1);//min of 0.1 since don't want an infinite slope/div 0
diffuse_amount=max( (slider4/100) -1,0); //clamp to >0


//parameter migration from old version, which had Frequency & Time response 0-1 instead of 0-100
Expand Down Expand Up @@ -313,4 +317,18 @@ mode==1?
pos += 2;
pos2=(pos2+2)%(fftsize*2);

mode > 1 ?
(
L_diff=(spl6-spl4)*0.5;
R_diff=(spl7-spl5)*0.5;

spl6-=L_diff*(diffuse_amount);
spl4+=L_diff*(diffuse_amount);

spl7-=R_diff*(diffuse_amount);
spl5+=R_diff*(diffuse_amount);


)

@gfx 500 500
6 changes: 3 additions & 3 deletions Library/surroundlib2.txt
Original file line number Diff line number Diff line change
Expand Up @@ -191,10 +191,10 @@ sumMid=0+delta;
sumSide=0;


function MidSide_stats_collect(ch_offs_ms)
function MidSide_stats_collect(ch_offs_ms,ch_offs_ms2)
(
Mid=( spl(ch_offs_ms)+spl(ch_offs_ms+1))*0.5;//compute Mid/Side
Side=(spl(ch_offs_ms)-spl(ch_offs_ms+1))*0.5;
Mid=( spl(ch_offs_ms)+spl(ch_offs_ms2))*0.5;//compute Mid/Side
Side=(spl(ch_offs_ms)-spl(ch_offs_ms2))*0.5;

Mid_abs =Mid*sign(Mid) ; //get magnitude
Side_abs=Side*sign(Side) ;
Expand Down
11 changes: 6 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Mac:

It is advised to ENABLE **"options > show in FX list > JSFX filename"** in your FX browser, as I refer to them by name. Bugs/suggestions? File an [issue](https://github.com/junh1024/Reaper-Surround/issues) , or contact me on [twitter](https://twitter.com/junh1024/) .

Alternatively, [this video](https://www.youtube.com/watch?v=9EegrN-gF5o) shows how to install JSFX.

Donations
---
Surround is just a hobby for me since 2014. If you use them (especially commercially), you are encouraged to donate. By CC (securely handled by stripe) on https://donorbox.org/junh1024 to encourage further development & lets me know they are genuinely useful for work. Also, contact me for custom development based on my stuff.
Expand Down Expand Up @@ -102,16 +104,16 @@ Panners

Upmixers
---
Upmixers are considered experimental & are based on matrixes. It's advisable to use DTS Neural upmix (DTS edition like http://i54.tinypic.com/xq9xt5.png , NOT waves edition - waves has a bug with LFE). I've also tried about 10 other upmixers and they're all deficient in some way.
Upmixers are considered experimental, based on matrix or FFT.

- 2.0 to 3.0 Upmix (C).txt (manual upmixer, all the others are automatic)
- 2.0 to 5.0 Upmix V2 (L).txt: 80% feature-complete DPL1-like surround upmixer, with more controls. [Note 1](#note-1), [Note 2](#note-2)
- 2.0 to 5.0 Upmix V2 (L).txt: 80% feature-complete DPL1-like surround upmixer with 0 audio latency, but a behavioral latency [Note 1](#note-1) . It works best as LCR upmixer [Note 2](#note-2), and that's the new default as of 2024.
- 2.0 to 5.0 Upmix V3 (S).txt: Upmix based on FFT for maximum separation. [see FFT Notes](#fft-notes) for controls & explanation. It's Competitive with commercial upmixers. Features:
- Basic image controls
- Doesn't lie about PDC
- Doesn't have an incorrect/downmix-incompatible bass level (bass is not moved/copied to LFE. It's blank.)
- CPU optimized (CPU use depends on channel output)
- Mandatory 100% phase accuracy by design. No "faux phase-accurate" mode which doesn't add to unity
- Mandatory phase-accurate by design. No "faux phase-accurate" mode which doesn't add to unity
- 2.0 to 5.0 Upmix V3 (L).txt: Above, plus
- Threshold controls which control the core algorithm, not 10 redundant controls that you can recreate in your DAW
- Adjustable filters to increase rear separation, make it sound nicer, less distracting
Expand Down Expand Up @@ -170,7 +172,7 @@ Effects (Third-Party, external)
Meters & Analysis
---
- Channel Similarity Meter (S).txt: Analysis of channel similarity based on FFT. Selection of 2/16ch input available.
- gfxGoniometer V2.txt: Compared to the original, automatic scaling of input, add pan analysis and selection of 2/16ch input, removes rays.
- gfxGoniometer V2.txt: A traditional phase vectorscope for stereo analysis. Compared to the original, adds automatic scaling of input, pan analysis, 2/16ch input selector for analysing surround, removes rays.

Specialist & Utility
---
Expand Down Expand Up @@ -280,7 +282,6 @@ You will need to use [**YSFX**](https://github.com/JoepVanlier/ysfx/releases/tag

Unfortunately, YSFX has [FFT issues](https://github.com/jpcima/ysfx/issues/66) so it rules out most of the interesting ones, and has trouble finding dependencies. I've made a small archive of 2 interesting FX & their dependancies for YSFX users [**here**](https://github.com/junh1024/Reaper-Surround/releases/download/0.2105/Reaper-Surround-YSFX.zip) .


### AAX Compatibility
AAX Compatibility for Pro Tools Windows is limited due to the FILM order for channels and limited options for channel count. I haven't tested this.

Expand Down

0 comments on commit 00b2d96

Please sign in to comment.