HardwareHeaven.com

HardwareHeaven.com

Looking for the skin chooser?
 
 
  • Home

  • Hardware reviews

  • Articles

  • News

  • Tools

  • Gaming at HardwareHeaven

  • Forums

 

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


Reply
 
Thread Tools
Old Mar 2, 2003, 10:28 PM   #1
HardwareHeaven Junior Member
 
Join Date: Feb 2003
Posts: 23
Rep Power: 0
fensoft is on a distinguished road

CrossFading

Why not add a crossfading dsp ?
-------------------
|-IN1L OUTL-|
|-IN1R OUTR-|
|-IN2L |
|-IN2R |
-------------------
when the cursor is put all has right, all the sound of IN1 and no sound of IN2 are sent to OUT
when one gradually brings the cursor to the center, the sound of IN2 is added gradually to OUT, while leaving the totality of the sound of IN1 with OUT, to finish has an addition of the 2 sources has identical volume.
and so on for the left ...
i have an external midi controler, so if someone can build this 'dsp', it will be very useful for me ...
i think its not harder than build a stereo mixer ...
thanks a lot, and sorry for my bad english ...
fensoft is offline   Reply With Quote


Old Mar 3, 2003, 01:35 AM   #2
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

like that maybe ;)?

Code:
name "switch-mix"
copyright "copyright: kX Project 2003."
created "just after the big boom"
guid "fcddd587-20ec-4560-bc82-0827f79c4f51"

input in0l, in0r, in1l, in1r      
output out1, out2
control switch = 0

interp out1, in0l, switch, in1l    
interp out2, in0r, switch, in1r

end
__________________
Max M. is offline   Reply With Quote
Old Mar 3, 2003, 11:53 AM Threadstarter Thread Starter   #3
HardwareHeaven Junior Member
 
Join Date: Feb 2003
Posts: 23
Rep Power: 0
fensoft is on a distinguished road

humm yes, but when set to 50%, 100% In1 and 100% In2 go to Out ...

maybe :
Code:
name "linear crossfade"
copyright "copyright: kX Project 2003."
created "just after the big boom;thanks to maxM and kX,the best drivers i ever seen"
guid "fcddd587-20ec-4560-bc82-0827f79c4f51"

input in0l, in0r, in1l, in1r      
output out1, out2
control switch = 0

interp out1, in0l, 2*(switch>0.5)*(switch-0.5), in1l    
interp out2, in0r, 2*(switch<0.5)*(-switch+0.5), in1r

end
but it think that 2*(switch>0.5)*(switch-0.5) won't work ...
is switch is considered as a vars ?

Last edited by fensoft; Mar 3, 2003 at 01:41 PM.
fensoft is offline   Reply With Quote
Old Mar 3, 2003, 03:11 PM   #4
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

ah, i think i understood you incorrectly, then you mean that when switch is at 100% both in1 and in2 should go to out with full level? or? (i think "cross" word confused me).
__________________
Max M. is offline   Reply With Quote
Old Mar 3, 2003, 05:58 PM   #5
HardwareHeaven Lover
 
Join Date: Feb 2003
Posts: 213
Rep Power: 0
Mata Hari is on a distinguished road

It's a dj cross function, full left = channel 1 goes to out, full right is channel 2 goes to out, and the mid position is both channels go to out (100% of both chans)

going from left to center, mixes channel 2 increasingly together with chan 1, and from center to right, channel 1 gets mixed out of the output
Mata Hari is offline   Reply With Quote
Old Mar 3, 2003, 06:03 PM   #6
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

ah, i see... ok... then above code does slightely different.. when switch is at 50%, in1/in2 go to out with 50% levels... hmm... let me think...
__________________
Max M. is offline   Reply With Quote
Old Mar 3, 2003, 08:59 PM   #7
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

Then i hope that the following code will do the trick
(however one should write the real plugin then - since it makes no sence to execute first two instructions 48000 times per second)

Code:
name "ok, hmm... djcf2003? ;)";
copyright "kX Project 2003."
created "almost just after the big boom"
guid "f8f2ae63-91ea-425d-9dcb-5dbe6ddafd2d";

input in0l, in0r, in1l, in1r
output outl, outr        
control switch           
temp x, y

macints	y, 0, switch, 2i
macints	x, accum, 1, -2i
macsn	0, 0, in0l, x   
macs	outl, accum, in1l, y     
macsn	0, 0, in0r, x   
macs	outr, accum, in1r, y

end
__________________

Last edited by Max M.; Mar 3, 2003 at 09:16 PM.
Max M. is offline   Reply With Quote
Old Mar 3, 2003, 09:24 PM   #8
Freedom is a feature.
 
RIV@NVX's Avatar
 
Join Date: Jul 2002
Location: Croatia, Rijeka
Posts: 4,476
Rep Power: 0
RIV@NVX will become famous soon enough
System Specs

Will this be included in 3531?
Looks cool
__________________
-- Vedran
RIV@NVX is offline   Reply With Quote
Old Mar 3, 2003, 09:27 PM Threadstarter Thread Starter   #9
HardwareHeaven Junior Member
 
Join Date: Feb 2003
Posts: 23
Rep Power: 0
fensoft is on a distinguished road

[OOPS, SORRY, i've erased your post by mistake, my apologies... too many buttons around there... well... sorry again... could it be to hard for you to reproduce some stantments of it?]

/bad Max ;(

Last edited by Max M.; Mar 3, 2003 at 11:58 PM.
fensoft is offline   Reply With Quote
Old Mar 3, 2003, 11:56 PM   #10
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

>>however one should write the real plugin then
>is it very problematic ? what consequence ?

well, no (i mean no problemo)...

>and it seems to corupt the stereo

it should not, i cannot reproduce such behaviour... maybe you've seen some "clue"... sometimes it happens...

>and ... it is as10k1 code

it is not as10k1 code, it is Dane code... but since both assemblers are written for the same dsp and syntaxes (at least their pure assembly part) are less or more similiar, as10k1 manual is recommended as the only less or more detailed general guide to emu10kx dsp assembly available for the moment...

>i think its because of accum...

maybe... another unknown accum side effect?... although i still cannot reproduce such... nevermind though...

btw. your card model?
__________________
Max M. is offline   Reply With Quote
Old Mar 4, 2003, 01:56 AM   #11
DriverHeaven Addict
 
Join Date: Dec 2002
Posts: 259
Rep Power: 0
eyagos is on a distinguished road

Ups, nice use of accum register Max. I writed another one, but mine uses much more registers and instructions. Of course, with a dll this effect would be much more simple.

Here is my code, larger but more "linear" if a dll is not avaliable:

Code:
name "you don't have to be good, to be my girl... :drool: ";
	copyright "Copyright (c) 2003.";
	created "03/03/2003";
	engine "kX";
	guid "2ad36552-c7ac-4421-a95f-f2440f35d0a7";
	
    input   in0L,in0R,in1L,in1R
    output  outL, outR      
    control switch = 0.5
    temp    s,i0L,i0R,i1L,i1R
    
    macs    i0L,0,in0L,0.5
    macs    i0R,0,in0R,0.5
    macs    i1L,0,in1L,0.5
    macs    i1R,0,in1R,0.5
    
    macints s,0,switch,0x2
    macs    outL,i0L,i1L,s
    macs    outR,i0R,i1R,s
    macsn   s,switch,0.5,1
    skip    ccr,ccr,0x4,0x3
    macints s,1,s,-2i
    macs    outL,i1L,i0L,s
    macs    outR,i1R,i0R,s

end
Note that inputs are divided by two to avoid saturations.
eyagos is offline   Reply With Quote
Old Mar 4, 2003, 10:20 AM   #12
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

"Linear" - what this means?. "Saturation" - well, the one can just set master level to 0.5 (since saturation occures just right before output in epilog - not in plug-in, there's no sense to put all eggs into one basket)...
__________________
Max M. is offline   Reply With Quote
Old Mar 4, 2003, 11:50 AM Threadstarter Thread Starter   #13
HardwareHeaven Junior Member
 
Join Date: Feb 2003
Posts: 23
Rep Power: 0
fensoft is on a distinguished road

Max's crossfader doesn't work : look at http://fensofty.free.fr/onlyleft.jpg ; input left and output left and right ...
i remade this code, and seems to work better just copy&paste 2 lines
Code:
name "ok, hmm... djcf2003? ";
copyright "kX Project 2003."
created "almost just after the big boom"
guid "f8f2ae63-91ea-425d-9dcb-5dbe6ddafd2d";

input in0l, in0r, in1l, in1r
output outl, outr        
control switch           
temp x, y

macints	y, 0, switch, 2i
macints	x, accum, 1, -2i
macsn	0, 0, in0l, x
macs	outl, accum, in1l, y
macints	y, 0, switch, 2i
macints	x, accum, 1, -2i
macsn	0, 0, in0r, x
macs	outr, accum, in1r, y

end
fensoft is offline   Reply With Quote
Old Mar 4, 2003, 12:39 PM   #14
DriverHeaven Addict
 
Join Date: Dec 2002
Posts: 259
Rep Power: 0
eyagos is on a distinguished road

fensoft, Max plugin works correctly. That photo doesn't show his "normal" behavior. Although some times I have observerd such "errors" in other situations. May be that two lines solves some kind of problem with accumulator.

Max, you are true. In my design, temporal regsiters are needed, so I killed two birds in one shoot dividing inputs by two. But I have made the comparison and both desings gives the same results.
eyagos is offline   Reply With Quote
Old Mar 4, 2003, 07:12 PM   #15
h/h member-shmember
 
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69
Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!Max M. is just super!

ok, then we've got something that will work untill integrated one (31?) one way or another. Kxl version will require only four instructions and two registers (excluding i/o). Even additional "gain" fader can be made with no register cost. nice.
__________________
Max M. is offline   Reply With Quote
Reply

Thread Tools