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 Dec 4, 2003, 04:20 PM   #1
DriverHeaven Addict
 
Join Date: Dec 2002
Posts: 259
Rep Power: 0
eyagos is on a distinguished road

Peak plugin with one register less

Well, the actual code of peak is

Quote:
; Registers
input peak_l, peak_r;
static result_l=0x0, result_r=0x0, resolution=0x1f;
temp tmp

; Code
log tmp, peak_l, resolution, 0x1;
limit result_l, tmp, tmp, result_l;
log tmp, peak_r, resolution, 0x1;
limit result_r, tmp, tmp, result_r;
Here the logarithm of the input (in abs value) is taken, and the dll uses a formula to convert it into the sacle of the vumeter gaph.

But is not necesary to take the logarithm of the input. If you just take the abs of the inputs (the resolution=0x1F register is not needed there), and uses a different formula in the dll to ake the conversion, the result would be exactly the same


Quote:
; Registers
input peak_l, peak_r;
static result_l=0x0, result_r=0x0
temp tmp

; Code
tstneg tmp, peak_l, peak_l, 0x0;
limit result_l, tmp, tmp, result_l;
tstneg tmp, peak_r, peak_r, 0x0;
limit result_r, tmp, tmp, result_r;
Only modifying the conversion formula in the dll, the result would be exactly the same.
eyagos is offline   Reply With Quote


Old Dec 4, 2003, 05:22 PM   #2
kX Project Lead Programmer and Coordinator
 
Join Date: Dec 2002
Posts: 3,119
Rep Power: 75
Eugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud ofEugene Gavrilov has much to be proud of

sounds reasonable. I'll have a look -- thanks

/E
Eugene Gavrilov is offline   Reply With Quote
Old Dec 13, 2003, 02:36 PM   #3
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!

(btw. E. this is exactly like in ufx's peakmeter and i wrote to you about this)
In fact, "log" (as well as "exp") instruction of fx8010 is just an approximation so it gives ~0.5dB error at every "2*(n+1)*3db" peakmeter value... So method with "linear" dsp code and linear->logarithmic conversion with kxl (e.g. using C) is preferred...
__________________

Last edited by Max M.; Dec 13, 2003 at 03:45 PM.
Max M. is offline   Reply With Quote
Reply

Thread Tools