DriverHeaven.net

Looking for the skin chooser?
 
 
  • Home

  • Reviews

  • Articles

  • News

  • Tools

  • GamingHeaven

  • Forums

  • Network

 

Go Back   DriverHeaven.net > Forums > Hardware and Related Topics > kX Project Audio Driver Support Forum > Effects and the DSP


Reply
 
LinkBack Thread Tools
Old May 4, 2009, 07:44 PM   #1
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

((X)) Surround System

Hi. I started making a plugin, ((X)) Surround System, last weekend that seems to be upmixing 2ch audio in a fashion reminiscent of Dolby Pro Logic II. I'm not totally sure if it actively matrixes anything, but I'm sure someone else can figure that out.

Here are the sources that I have been using while developing this plugin:

http://www.dolby.com/uploadedFiles/z..._Operation.pdf

Dolby Pro Logic - Wikipedia, the free encyclopedia

I would say that it has been coming along well, but I can't figure out how to correctly apply a matrix. I am also looking for a better way to compare the status of the different channels so that the separation will be better, and I can fully remove voices from the rear channels, whether they are in the center, left, or right channel of the stereo track. For example, if you listen to a song, particularly Basket Case by Danger Doom, where someone is saying something only from the right channel, it will playback in the rear right with a distinguishable level of prominence while playing in the front at the same time.

The code is below:
-------------------------------------------------------------------------
; Registers
input in_L, in_R;
output L, R, Ls;
output Rs, C;
static C_constant=0x5a827999, SL_phase=0x7fffffff, Sr_phase=0x80000000;
temp SL, Sr, offsetrL;
temp offsetrR

; Code
macs C, in_L, in_R, C_constant;
macsn SL, in_R, in_L, 0x7fffffff;
macs Ls, offsetrL, SL, SL_phase;
macsn Sr, in_L, in_R, 0x7fffffff;
macs Rs, offsetrR, Sr, Sr_phase;
limit SL, Sr, L, Ls;
limit offsetrL, 0x80000000, Rs, offsetrL;
limit Sr, SL, R, Rs;
limit offsetrR, 0x80000000, Ls, offsetrR;
macsn L, C, in_R, 0x20000000;
macsn R, C, in_L, 0x20000000;

end
-------------------------------------------------------------------------

The code is from the sixth edition that I have made; I can post the earlier versions if anyone is interested. I would also prefer to keep it ultralight by removing anything that it doesn't need to be functional that can be taken up by another plugin, like speaker delays.

Here are some of my sources for testing its ability to upmix 2ch audio:
YouTube - Killzone 2 Gameplay HD 720P Widescreen HD Quality
DiRT Video Game, Dusty Trails Gameplay HD | Game Trailers & Videos | GameTrailers.com
YouTube - Gran Turismo 5 Prologue: Ferrari F40 replay
YouTube - Sonic Unleashed Trailer "High Europe" Spagonia
YouTube - Gran Turismo 5 Prologue: Ferrari F40 replay
YouTube - Ferrari F40 testdrive by FifthGear
YouTube - Soul Calibur IV Hilde And Sophitia Gameplay
YouTube - Project Gotham Racing 4 - Corvette HD
YouTube - Project Gotham Racing 4 (PGR4) [Tokio]
and Computer games like NFSU2, GRID, CoD 4 etc.
Footage from movies and television like the Fifth Gear test drive should be usable.

For the record, my knowledge and understanding of this kind of stuff is very limited, and I don't fully understand the instructions.
I also don't know if this guide covers all of them.
kX Project -- A Beginner's Practical Guide to Programming Digital Audio Effects on the E-MU10kx family of DSPs in the kX Project Environment
As a result, anything that can help me understand them will be valuable to me.
Thanks!
Maxon is offline   Reply With Quote


Old May 5, 2009, 07:40 AM   #2
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,400
Rep Power: 47
Max M. will become famous soon enough

Îòâåò: ((X)) Surround System

>As a result, anything that can help me understand them will be valuable to me.

well, there's nothing complicated there really. In fact one should start with understanding the only instruction: macs, as multiplication and addition cover 99.9% of signal processing algorithms. The rest is just a matter of understanding the effect algorithm and the math behind it. And this (the algorithm and the math) is what i would recommend you to dig into first
- start with writing the algorithm math on a paper in some pseudocode (whichever "pseudo" you feel better with - for example: "a = b + c + d * e - f * g") and then convert the stuff into dane code. You can always ask us here for the details on a particular instruction and its use in a certain algorithm chunk - but first, the algorithm itself, algorithm, algorithm, algorithm!
__________________

Last edited by Max M.; May 5, 2009 at 01:29 PM.
Max M. is offline   Reply With Quote
Old May 9, 2009, 08:49 PM   #3
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

Hi again. Thanks for the advice; I got the matrixing right this time . However, in order to keep the sounds from the left and right channels that should be playing in the front, like dialogue on the left or right, from playing in the surround speakers, I need to be to make a voltage-controlled amplifier that will lower one channel and raise the other when sounds like those play. I am assuming that making the volume multipliers for the Ls and Rs channels inversely proportional would work, but I'm not sure how to do it. Is there a way to use the MACS function so that the R operand is constant without using the constant register? I tried using the constant register, but it can't be used as R in the function.
Thanks again.

Oh yeah, I need to be able to do something like this in order to set up the L and R channels in stereo. Otherwise, they play sounds that should only be coming from the back.

Last edited by Maxon; May 9, 2009 at 08:55 PM. Reason: I forgot an important detail,
Maxon is offline   Reply With Quote
Old May 9, 2009, 09:52 PM   #4
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,400
Rep Power: 47
Max M. will become famous soon enough

Îòâåò: ((X)) Surround System

>I am assuming that making the volume multipliers for the Ls and Rs channels inversely proportional would work

Nope. Don't miss the important detail - the VCA should be controlled not by the signal waveform (what you're trying to do) but by the signal envelope - which you need to extract first. Or, in other words - the "balancing servo" engine of the active matrix is just a kind of dynamics processing, or yet in another words, simply a form of compressor/expander. To give you more keywords for search (algorithms! ;): "envelope detector + vca".

>Is there a way to use the MACS function so that the R operand is constant without using the constant register?

No, you cannot "invert" an instruction operation by "swapping" the meaning of its operands.
Well, the "inverted" multiplication could be a division or (depending on the goal) inversion of multiplier itself (like a = b * (1 - c))
- but this is not what you really need (at the moment). The sample-per-sample multiplication/division of one waveform by another will give you just a distortion not a "level control".

----
I guess your next turn is to dig into "compression algo" articles/papers ;) (like this for example)
__________________

Last edited by Max M.; May 10, 2009 at 12:16 AM.
Max M. is offline   Reply With Quote
Old May 23, 2009, 01:24 PM   #5
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

I'm trying to get the first envelope detection method mentioned above working. When I play it back as an output signal, it comes out distorted.
http://www.mathworks.com/products/demos/shipping/dspblks/dspenvdet.html#7
Also, how do I get a visual confirmation of the detection?

Last edited by Maxon; May 23, 2009 at 01:25 PM. Reason: Posted the wrong link.
Maxon is offline   Reply With Quote
Old May 23, 2009, 02:05 PM   #6
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,400
Rep Power: 47
Max M. will become famous soon enough

Îòâåò: ((X)) Surround System

well, you can assing the output of the detector to an extra output of the plugin and then analyze it the waty you like (for example record in your favorite editor and check visually)
__________________
Max M. is offline   Reply With Quote
Old Jun 2, 2009, 01:00 PM   #7
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

Forget what I said; I've got it now. I'll probably work more on this next week after I've taken all of my finals.

I got the envelope detection working for the left and right totals. If I'm correct, I should have to detect the envelope for the L+R and L-R signals as well, but that should be a later concern. Anyway, I'm still not sure how to go about setting up the VCA in its entirety.
Variable-gain amplifier - Wikipedia, the free encyclopedia
Voltage Controlled Amplifier
SSM2018 | Trimless Voltage Controlled Amplifier | Operational Amplifiers (Op Amps) | Amplifiers and Comparators | Analog Devices
4QD-TEC: Voltage controlled amplifier circuit
I did some searching, but all I can find are circuit diagrams. I'm assuming that I am going to have to understand them before I can finish this plug-in. This would also mean that I will have to study electronics up to a level appropriate for this.
Would these be good places to start?
Electronics: An Online Guide for Beginners - Schematic Diagrams
Tutorial - How to Read a Schematic
The Physics Classroom
Learn Physics Today!
Electricity & Magnetism

Last edited by Maxon; Jun 3, 2009 at 05:21 PM. Reason: I can solve the aforementioned problem
Maxon is offline   Reply With Quote
Old Jun 5, 2009, 07:02 AM   #8
d/h member-shmember
 
Max M.'s Avatar
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,400
Rep Power: 47
Max M. will become famous soon enough

Îòâåò: ((X)) Surround System

Quote:
Anyway, I'm still not sure how to go about setting up the VCA in its entirety.
That's not the hardest part of it. You just use your envelope (but after applying appropriate attack/release timings and necessary scale, that's the trick - see below) directly as VCA multiplier, e.g. it's just: "output = input * voltage_control" (and this single line is the complete VCA module).
The tricky parts are:
1. What timings you will need to apply to your envelope before VCA (e.g. how fast changes in envelope level will affect corresponding output level changes) - assuming the "active matrix" is somewhat similar to "automatic level normalizer" - that would be relatively short attack and pretty long release.
2. How deep (e.g. the "scale") and in what degree the envelope level should affect corresponding output - e.g. you need to convert your initial arrangement (... "to compare the status of the different channels so that the separation will be better, and I can fully remove voices from the rear channels, whether they are in the center, left, or right channel of the stereo track...") into the math. E.g. sorta "which levels of which channel to which 'voltage_control' and how".

Etc.

Quote:
I'm assuming that I am going to have to understand them before I can finish this plug-in.
I don't think any VCA circuits will shed a light on that - just because the magic of an "active matrix" is really outside the VCA. Have you read those tutorials/articles about compression and dynamics processing ("compression" as in Dynamic range compression - Wikipedia, the free encyclopedia, Harmony Central - Compression/Limiting etc. etc.)? I believe that should give to you a lot of hints on the math behind the stuff even if there isn't any math equations or code.
As for the exact layout and fine-tuning of all those active-matrix modules (envelope detector, timing filters, vca), well, i guess only a complete documentation and/or source code for a "dolby-like" active-matrix can provide precise direction - but i'm not aware of such documentation/code. So it's going to be total trial-and-error.

After all, i'd said that the "active surround matrix" is quite complex thing to make it completely from scratch - as there's no common convention for such processing and the algorithms of proprietary processors are completely undocumented. So well, perhaps, first i'd suggested to start with a minimalistic compressor module or a sort-of - just to become less or more familiar with typical dynamics processing building blocks and a variety of options they provide. Otherwise it's going to be a nightmare for you due to infinite number of unknowns.

Something like that i guess (maybe not so helpful - sorry).
__________________

Last edited by Max M.; Jun 5, 2009 at 07:16 AM.
Max M. is offline   Reply With Quote
Old Jun 20, 2009, 02:59 PM   #9
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

I've got excellent news: the plugin is almost finished. Unfortunately, it is not entirely true to DPLII thanks to the lack of solid documentation on the VCAs, which had been mentioned previously. I'll update this post with what I have managed to finish as of late in a few days; I want to see if there is anything I can do to bring it closer.
Maxon is offline   Reply With Quote
Old Jul 1, 2009, 06:59 PM   #10
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

What I said would take a few days ended up taking longer than a week...Oh well.
Anyway, I have one last question before I put up the code. The compression works, but Dolby Pro Logic II has a feature that allows it to change the response time in real time based on the gain at any given moment. How would I go about implementing this?
Maxon is offline   Reply With Quote
Old Jul 28, 2009, 05:05 PM   #11
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,037
Rep Power: 56
Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!

Îòâåò: ((X)) Surround System

I guess you need a delay line with some variable time pointer, but I suggest you send a message to Max M. concerning this

looking forward to trying your plugin

E.
Eugene Gavrilov is offline   Reply With Quote
Old Aug 25, 2009, 04:42 PM   #12
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

Hi. I got everything working, but I went back and rewrote much of the plugin. It sounds many times better than it did in July.

Anyway, I'm finally releasing it, but there are some things that should be mentioned first:

It is not done. There are still things that I want to try with it, such as other methods for creating a matrix surround effect that are not included in the plugin.
HeadWize - Technical Paper: Pro Logic Surround Decoder Principles of Operation by Roger Dressler
Either way, The front and rear L and R channels are in full stereo. However, the source affects the placement of stereo sounds. For example, a sound that is supposed to be dominant in the left speaker may play as though it is closer to the center speaker than it would have been without my plugin, or may even play like it is coming from the center speaker. Luckily, this does not normally happen. Every source I tried, save for one or two exceptions out of the hundreds I have run through, play back as intended. As for the compression, sudden and noticeable changes in volume pretty much don't happen. When I use DScaler 4: DScaler - TV Viewer, I don't notice any sudden changes in volume while playing Xbox 360 or Gamecube unless I play Kirby Air Ride. That game is pretty much the only reason that I'm sure the variable delay probably works. :/

Within the past month or so, I have been able to test this plugin with Dolby Pro Logic II sources. It seemed to work very well, much better than the version that I tested on July 1st. However, my speakers are so bad that I had been using filters like the highshelf and the timbre one while I developed the plugin. Regardless, it seemed to work very well when I tested it today without those filters in place.

Based on the previous paragraph, it should be a given that I don't have full-range speakers to work with. As a result, I didn't even bother with bass redirection. I do recommend sending the C signal to both the center and subwoofer outputs though. I also recommend using the EQ Highpass filter for all of the outputs, but I would imagine that it would work pretty well without it from the tests I ran today. If you do use a highpass filter, set the surround one to 300/3.50. Just to make sure this is obvious, I only use the highpass filter because all of the very low frequency sounds I hear end up in my subwoofer.

I am learning more about minimum-phase filters, and will eventually rewrite the entire lowpass section that is used in the envelope detection. I have no idea when I will be able to do that though.

As I said before, it is unfinished. I am sure that I have made some mistakes, particularly with the surround channels. As mentioned in my previous posts, any help to correct these is greatly appreciated.

You might have noticed that I offered no absolutes, except for not being finished, in the previous paragraphs. I have only tried this on one system, and don't believe that I have any idea how it will work on yours. It's possible that I'm being paranoid, I hope I am anyway, but I just wanted to make this as obvious as possible. On the other hand, I believe that it would be fair to say that the version posted above is in no way even remotely as good as this new one.

As for resources (I don't know the units), it uses:
129 Instrs (I'm assuming that stands for instructions)
129 GPRs
0 iTram/iTramSize: 0 (That was kinda obvious...oh well)
16 xTram/xTramSize 2/256 (This is for the response time that I mentioned in my July 1st post. I do recommend speaker delays after the processing.)

For anyone who's interested in knowing before they try it, it uses 229 instructions and 174 GPRs when it is used with p16v and epilog. There are enough resources to have 80 GPRs and 483 instructions left over after adding a 10 Band EQ for the front, center, and surround channels as three separate entities when using an SB0244.


Quote:

name "((X)) Surround System"
engine "kX";
created "05/02/2009";
guid "c96c0dfd-457a-4ff8-8a4c-abcd4db744d7";
; Registers
input in_L, in_R;
output L, R, Ls;
output Rs, C;
static vllp=0x0;
static vrlp=0x0, vld1=0x0, vrd1=0x0;
static vld2=0x0, vrd2=0x0, vld3=0x0;
static vrd3=0x0, vld4=0x0, vrd4=0x0;
static p0=0xb39c, p1=0x16738, p2=0xb39c;
static a1=0x7ff2795f, a2=0xc00ab830, sca=0x2;
static fracl=0x0, ffracl=0x0, fracr=0x0;
static ffracr=0x0, vcal=0x0, vcar=0x0;

temp SL, Sr, SLC;
temp SLCr, pSLCr, SRCL;
temp SRC, SC, Cl;
temp Cr, Ct, pLs;
temp ppls, prs, pprs;
temp vldl, vlhr, vlr;
temp vrhr, vrr, vlt1;
temp vlt2, vrt1, vrt2;
temp vlrf, vrrf, vlrfg;
temp vrrfg, vsqrtl, vsqrtr;
temp sqrt1, sqrt2, sqrt3, sqrt4, t1;
temp t2, vcacl, vcacr;
temp vcaccl,fL,fR;
temp vcaccr, b_l, b_r;
temp fraclf, fracrf, pL, pR, ppL,ppR, addLR,addLRsq
temp vfd1,vfd2,vfd3,vfd4,vrf,vrff,fracf,fracff
temp fracre,fracref,vred1,vred2,vred3,vred4,subLR,subLR sq
temp vref,vreff,b_f,b_re,vcaf,vcare,vcaccf,vcaccre,pLLs ,pRRs,pC
temp pxL,pxR,pLr,pRr,d_l,d_r,d_f,d_re,vpl,vpr,fLa,fRa

xtramsize 1200

xdelay read dl at 0
xdelay write dwl at 0
xdelay read pvcaxl at 0
xdelay write vcaxl at 0
xdelay read dr at 0
xdelay write dwr at 0
xdelay read pvcaxr at 0
xdelay write vcaxr at 0
xdelay read dre at 0
xdelay write dwre at 0
xdelay read pvcaxre at 0
xdelay write vcaxre at 0
xdelay read df at 0
xdelay write dwf at 0
xdelay read pvcaxf at 0
xdelay write vcaxf at 0

; Code
macs vlhr, 0x0, pL, pL;
macs 0x0, 0x0, 0x0, 0x0;
macmv vld2, vld1, vld2, p2;
macmv vld1, vlhr, vld1, p1;
macmv t1, t1, vlhr, p0;
macmv vld4, vld3, vld4, a2;
macmv t1, t1, vld3, a1;
macs t2, accum, 0x0, 0x7fffffff;
macints vld3, 0x0, t2, sca;
macs vlrf, vld3, 0x0, 0x0;
macs vlr, 0x0, vlrf, 0x7fffffff;
log sqrt1, vlr, 0x1f, 0x1;
macs sqrt1, 0x40000000, sqrt1, 0x40000000;
exp fracl, sqrt1, 0x1f, 0x1;
macints fraclf, 0x0, fracl, 38000;
macs vrhr, 0x0, pR, pR;
macs 0x0, 0x0, 0x0, 0x0;
macmv vrd2, vrd1, vrd2, p2;
macmv vrd1, vrhr, vrd1, p1;
macmv t1, t1, vrhr, p0;
macmv vrd4, vrd3, vrd4, a2;
macmv t1, t1, vrd3, a1;
macs t2, accum, 0x0, 0x0;
macints vrd3, 0x0, t2, sca;
macs vrrf, vrd3, 0x0, 0x0;
macs vrr, 0x0, vrrf, 0x7fffffff;
log sqrt2, vrr, 0x1f, 0x1;
macs sqrt2, 0x40000000, sqrt2, 0x40000000;
exp fracr, sqrt2, 0x1f, 0x1;
macints fracrf, 0x0, fracr, 20000;

macs addLR, pL, pR,1;
macs addLRsq, 0,addLR,addLR
macs 0x0, 0x0, 0x0, 0x0;
macmv vfd2, vfd1, vfd2, p2;
macmv vfd1, addLRsq, vfd1, p1;
macmv t1, t1, addLRsq, p0;
macmv vfd4, vfd3, vfd4, a2;
macmv t1, t1, vfd3, a1;
macs t2, accum, 0x0, 0x0;
macints vfd3, 0x0, t2, sca;
macs vrff, vfd3, 0x0, 0x0;
macs vrf, 0x0, vrff, 0x7fffffff;
log sqrt3, vrf, 0x1f, 0x1;
macs sqrt3, 0x40000000, sqrt3, 0x40000000;
exp fracf, sqrt3, 0x1f, 0x1;
macints fracff, 0,fracf, 40000;

macsn subLR, pL, pR,1;
macs subLRsq, 0,subLR,subLR
macs 0x0, 0x0, 0x0, 0x0;
macmv vred2, vred1, vred2, p2;
macmv vred1, subLRsq, vred1, p1;
macmv t1, t1, subLRsq, p0;
macmv vred4, vred3, vred4, a2;
macmv t1, t1, vred3, a1;
macs t2, accum, 0x0, 0x0;
macints vred3, 0x0, t2, sca;
macs vreff, vred3, 0x0, 0x0;
macs vref, 0x0, vreff, 0x7fffffff;
log sqrt4, vref, 0x1f, 0x1;
macs sqrt4, 0x40000000, sqrt4, 0x40000000;
exp fracre, sqrt4, 0x1f, 0x1;
macints fracref, 0x0, fracre, 40000;


macs Cl, 0x0, vpL, vcaxf;
macs Cr, 0x0, vpR, vcaxf
macs Ct, Cl, Cr, 0x7fffffff;
macs fLa, 0,fL,0.4
macs fRa, 0,fR,0.4
macs pC, fLa, fRa, 1
macw C,0,pC,d_f

macs pLr,0,pL,vcaxre
macs pRr,0,pR,vcaxre

macsn SL, vpL, vpR, 1;
macs SLC, 0x0, Sr, 0x55555555;
macs SRCL, 0x0, SL, 0x2aaaaaa9;
macs pLs, SLC, SRCL, 0x7fffffff;
macs ppls, 0x0, pLs, 1;
macs pLLs, 0,ppls,d_re
macw Ls,0,pLLs,d_l

macsn Sr, vpR, vpL, 1;
macs SRC, 0x0, SL, 0x55555555;
macs SLCr, 0x0, Sr, 0x2aaaaaa9;
macs prs, SLCr, SRC, 0x7fffffff;
macs pprs, 0x0, prs, 1;
macs pRRs, 0, pprs,d_re;
macw Rs,0,pRRs,d_r



macsn b_l, fraclf, fracrf,0
tstneg d_l, b_l,b_l,0
macs dwl, d_l,0,0
macs &dl,0,&dwl,0.7

macsn b_r, fracrf, fraclf,0
tstneg d_r, b_r,b_r,0
macs dwr, d_r,0,0
macs &dr,0,&dwr,0.7

macsn b_f, fracff, fracref,0
tstneg d_f, b_f,b_f,0
macs dwf, d_f,0,0
macs &df,0,&dwf,0.5

macsn b_re,fracref,fracff,0
tstneg d_re, b_re,b_re,0
macs dwre, d_re,0,0
macs &dre,0,&dwre,0.7


macs vcal, 0,dl, 1
macs vcar, 0,dr, 1

macs vcaf, 0,df,1
macs vcare, 0,dre,1


limitn vcaccl, vcal, b_r, b_l;
macints pvcaxl, 0, vcaccl,b_l
macints vcaxl, 0,pvcaxl,24

limitn vcaccr, vcar, b_l, b_r;
macints pvcaxr, 0, vcaccr,b_r
macints vcaxr, 0,pvcaxr,24

limitn vcaccf, vcaf, b_re, b_f
macints pvcaxf, 0, vcaccf,b_f
macs vcaxf,0,pvcaxf,48


limitn vcaccre,vcare, b_f, b_re
macints pvcaxre, 0, vcaccre,b_re
macints vcaxre,0 ,pvcaxre,240

macs pL, 0x0, in_L, vcaxl
macs vpL, 0,pL,0.1391
macs pR, 0x0, in_R, vcaxr;
macs vpR, 0,pR,0.1391

macw L,0,fL,d_l
macs fL,ppL,pxL,1
macs pxL,0,Cr,0.7
macs ppL,0, vpL,vcaxf
macw R,0,fR,d_r
macs fR,ppR,pxR,1
macs pxR,0,Cl,0.7
macs ppR,0, vpR,vcaxf

end
I mentioned this earlier, but I want to say it again. Tell me about anything that isn't working well or correctly, preferably in detail.
Maxon is offline   Reply With Quote
Old Aug 25, 2009, 05:04 PM   #13
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

That last post got rather large! I forgot to mention that this plugin is significantly quieter than an unaltered signal. It has to be quieter to avoid distortion.

Here are some more sources to test it with:

YouTube - Mario & Sonic at the Olympic Winter Games - Official Dutch Trailer [HD]
YouTube - District 9 - Official Trailer 2 [HD]
YouTube - [JGTC] Super GT 2008 Round-Final Fuji start
YouTube - Xbox 360 - Forza Motorsport® 3 - E3 Trailer
YouTube - Forza Motorsport 3 - Aston Martin DBS Gameplay[Alpha Build] [HD]
YouTube - Gran Turismo 5 - Official E3 Trailer [HD]
YouTube - GC 2008: Killzone 2 Multiplayer Trailer 1 [High Quality]
YouTube - Gran Turismo 5 'GamesCom 09 Subaru Gameplay' TRUE-HD QUALITY
Maxon is offline   Reply With Quote
Old Sep 15, 2009, 08:21 PM   #14
DriverHeaven Newbie
 
Join Date: May 2009
Posts: 9
Rep Power: 0
Maxon is on a distinguished road

Re: ((X)) Surround System

I've set up a new version. It fixes several of the problems in the last one.

Quote:

name "((X)) Surround System"
engine "kX";
created "05/02/2009";
guid "c96c0dfd-457a-4ff8-8a4c-abcd4db744d7";
; Registers
input in_L, in_R;
output L, R, Ls;
output Rs, C;
static vllp=0x0;
static vrlp=0x0, vld1=0x0, vrd1=0x0;
static vld2=0x0, vrd2=0x0, vld3=0x0;
static vrd3=0x0, vld4=0x0, vrd4=0x0;
static p0=0xb39c, p1=0x16738, p2=0xb39c;
static a1=0x7ff2795f, a2=0xc00ab830, sca=0x2;
static fracl=0x0, ffracl=0x0, fracr=0x0;
static ffracr=0x0, vcal=0x0, vcar=0x0;

temp SL, Sr, SLC;
temp SLCr, pSLCr, SRCL;
temp SRC, SC, Cl;
temp Cr, Ct, pLs;
temp ppls, prs, pprs;
temp vldl, vlhr, vlr;
temp vrhr, vrr, vlt1;
temp vlt2, vrt1, vrt2;
temp vlrf, vrrf, vlrfg;
temp vrrfg, vsqrtl, vsqrtr;
temp sqrt1, sqrt2, sqrt3, sqrt4, t1;
temp t2, vcacl, vcacr;
temp vcaccl,fL,fR;
temp vcaccr, b_l, b_r;
temp fraclf, fracrf, pL, pR, ppL,ppR, addLR,addLRsq
temp vfd1,vfd2,vfd3,vfd4,vrf,vrff,fracf,fracff
temp fracre,fracref,vred1,vred2,vred3,vred4,subLR,subLR sq
temp vref,vreff,b_f,b_re,vcaf,vcare,vcaccf,vcaccre,pLLs ,pRRs,pC
temp pxL,pxR,pLr,pRr,d_l,d_r,d_f,d_re,vpl,vpr,fLa,fRa,p LB,pRB
temp lB,rB, ppxR

xtramsize 6000

xdelay read dl at 0
xdelay write dwl at 0
xdelay read pvcaxl at 0
xdelay write vcaxl at 0
xdelay read dr at 0
xdelay write dwr at 0
xdelay read pvcaxr at 0
xdelay write vcaxr at 0
xdelay read dre at 0
xdelay write dwre at 0
xdelay read pvcaxre at 0
xdelay write vcaxre at 0
xdelay read df at 0
xdelay write dwf at 0
xdelay read pvcaxf at 0
xdelay write vcaxf at 0

; Code
macs vlhr, 0x0, pL, pL;
macs 0x0, 0x0, 0x0, 0x0;
macmv vld2, vld1, vld2, p2;
macmv vld1, vlhr, vld1, p1;
macmv t1, t1, vlhr, p0;
macmv vld4, vld3, vld4, a2;
macmv t1, t1, vld3, a1;
macs t2, accum, 0x0, 0x7fffffff;
macints vld3, 0x0, t2, sca;
macs vlrf, vld3, 0x0, 0x0;
macs vlr, 0x0, vlrf, 0x7fffffff;
log sqrt1, vlr, 0x1f, 0x1;
macs sqrt1, 0x40000000, sqrt1, 0x40000000;
exp fracl, sqrt1, 0x1f, 0x1;
macints fraclf, 0x0, fracl, 1400;
macs vrhr, 0x0, pR, pR;
macs 0x0, 0x0, 0x0, 0x0;
macmv vrd2, vrd1, vrd2, p2;
macmv vrd1, vrhr, vrd1, p1;
macmv t1, t1, vrhr, p0;
macmv vrd4, vrd3, vrd4, a2;
macmv t1, t1, vrd3, a1;
macs t2, accum, 0x0, 0x0;
macints vrd3, 0x0, t2, sca;
macs vrrf, vrd3, 0x0, 0x0;
macs vrr, 0x0, vrrf, 0x7fffffff;
log sqrt2, vrr, 0x1f, 0x1;
macs sqrt2, 0x40000000, sqrt2, 0x40000000;
exp fracr, sqrt2, 0x1f, 0x1;
macints fracrf, 0x0, fracr, 1400;

macs addLR, pL, pR,1;
macs addLRsq, 0,addLR,addLR
macs 0x0, 0x0, 0x0, 0x0;
macmv vfd2, vfd1, vfd2, p2;
macmv vfd1, addLRsq, vfd1, p1;
macmv t1, t1, addLRsq, p0;
macmv vfd4, vfd3, vfd4, a2;
macmv t1, t1, vfd3, a1;
macs t2, accum, 0x0, 0x0;
macints vfd3, 0x0, t2, sca;
macs vrff, vfd3, 0x0, 0x0;
macs vrf, 0x0, vrff, 0x7fffffff;
log sqrt3, vrf, 0x1f, 0x1;
macs sqrt3, 0x40000000, sqrt3, 0x40000000;
exp fracf, sqrt3, 0x1f, 0x1;
macints fracff, 0,fracf, 1400;

macsn subLR, pL, pR,1;
macs subLRsq, 0,subLR,subLR
macs 0x0, 0x0, 0x0, 0x0;
macmv vred2, vred1, vred2, p2;
macmv vred1, subLRsq, vred1, p1;
macmv t1, t1, subLRsq, p0;
macmv vred4, vred3, vred4, a2;
macmv t1, t1, vred3, a1;
macs t2, accum, 0x0, 0x0;
macints vred3, 0x0, t2, sca;
macs vreff, vred3, 0x0, 0x0;
macs vref, 0x0, vreff, 0x7fffffff;
log sqrt4, vref, 0x1f, 0x1;
macs sqrt4, 0x40000000, sqrt4, 0x40000000;
exp fracre, sqrt4, 0x1f, 0x1;
macints fracref, 0x0, fracre, 1400;


macs Cl, 0x0, vpL, vcaxf;
macs Cr, 0x0, vpR, vcaxf
macs Ct, Cl, Cr, 0x7fffffff;
macs fLa, 0,fL,0.5
macs fRa, 0,fR,0.5
macs pC, fLa, fRa, 1
macw C,0,pC,d_f

macs pLr,0,pL,vcaxre
macs pRr,0,pR,vcaxre

macsn SL, vpL, vpR, 1;
macs SLC, 0x0, Sr, 0x55555555;
macs SRCL, 0x0, SL, 0x2aaaaaa9;
macs pLs, SLC, SRCL, 0x7fffffff;
macs ppls, 0x0, pLs, 1;
macs pLLs, 0,ppls,d_re
macw Ls,0,pLLs,d_l

macsn Sr, vpR, vpL, 1;
macs SRC, 0x0, SL, 0x55555555;
macs SLCr, 0x0, Sr, 0x2aaaaaa9;
macs prs, SLCr, SRC, 0x7fffffff;
macs pprs, 0x0, prs, 1;
macs pRRs, 0, pprs,d_re;
macw Rs,0,pRRs,d_r



macsn b_l, fraclf, fracrf,0
tstneg d_l, b_l,b_l,0
macs dwl, d_l,0,0
macs &dl,0,&dwl,0.7

macsn b_r, fracrf, fraclf,0
tstneg d_r, b_r,b_r,0
macs dwr, d_r,0,0
macs &dr,0,&dwr,0.7

macsn b_f, fracff, fracref,0
tstneg d_f, b_f,b_f,0
macs dwf, d_f,0,0
macs &df,0,&dwf,0.5

macsn b_re,fracref,fracff,0
tstneg d_re, b_re,b_re,0
macs dwre, d_re,0,0
macs &dre,0,&dwre,0.7


macs vcal, 0,dl, 1
macs vcar, 0,dr, 1

macs vcaf, 0,df,1
macs vcare, 0,dre,1


limitn vcaccl, vcal, b_r, b_l;
macints pvcaxl, 0, vcaccl,b_l
macints vcaxl, 0,pvcaxl,2

limitn vcaccr, vcar, b_l, b_r;
macints pvcaxr, 0, vcaccr,b_r
macints vcaxr, 0,pvcaxr,2

limitn vcaccf, vcaf, b_re, b_f
macints pvcaxf, 0, vcaccf,b_f
macints vcaxf,0,pvcaxf,2


limitn vcaccre,vcare, b_f, b_re
macints pvcaxre, 0, vcaccre,b_re
macints vcaxre,0 ,pvcaxre,2

macints pLB, 0x0, in_L, 0x8
macs pL, 0x0, pLB, vcaxl
macs vpL, 0,pL,0.0599
macints pRB, 0x0, in_R, 0x8
macs pR, 0x0, pRB, vcaxr;
macs vpR, 0,pR,0.0599

macw L,0,fL,d_l
macs fL,ppL,pxL,1
macs pxL,0,Cr,0.7
macs ppL,0, vpL,vcaxf
macw R,0,fR,d_r
macs fR,ppR,pxR,1
macs pxR,0,Cl,0.7
macs ppxR,0, Cr,vcaxf
macs ppR,0,ppxR,vcaxf

end
Maxon is offline   Reply With Quote
Old Oct 15, 2009, 06:49 PM   #15
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,037
Rep Power: 56
Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!Eugene Gavrilov is just super!

Îòâåò: ((X)) Surround System

Thanks for the effect! I will add it to the next driver release. Unfortunately, I cannot test it myself: I only have stereo speakers at the moment...

E.
Eugene Gavrilov is offline   Reply With Quote
Reply

Bookmarks

Tags
matrix, matrix surround, surround sound, surround system

Thread Tools