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 Apr 28, 2011, 02:11 AM   #1
HardwareHeaven Lover
 
Join Date: Mar 2003
Posts: 127
Rep Power: 0
JoshuaChang is on a distinguished road

simulate the emu10kx's LOG instruct, need help

hi,
i'm tring to simulate the emu10kx's LOG instruct using C language, i've read the as10k1 manual and made a rough function, but couldn't get more progress, here is my code:
Code:
int emu10k_log(int x, int exp, int bits) {
    int sign;
    if(x>=0)
        sign=0;
    else
    {
        sign=1;
        x=~x+1;
    }
    while((x&0x80000000)==0 && exp>0)
    {
        x=x<<1;
        exp--;
    }
    if((x&0x80000000)==0x80000000)
        return !sign?(x>>bits&(0x1<<31-bits)-1)+(++exp<<31-bits):~((x>>bits&(0x1<<31-bits)-1)+(++exp<<31-bits))+1;
    if(x<0x1<<31-bits)
        return !sign?x:~x+1;
    while(x>0x1<<31-bits)
        x=x>>1;
    return !sign?x&(0x1<<31-bits)-1:~(x&(0x1<<31-bits)-1)+1;
}
refer to emu10kx's instruct: LOG R, A, X, Y;
x is the A, exp is the X, while bits is the sizeof(X), Y has not been implemented yet.
i have no experience on kx plugin's debug,
some one could give me these instruct's result(on real emu10kx chip)?
LOG R, 0x00012345, 0x7, 0x0;
LOG R, 0x00001234, 0x7, 0x0;
LOG R, 0x00000123, 0x7, 0x0;
LOG R, 0x00000012, 0x7, 0x0;
LOG R, 0x00000001, 0x7, 0x0;
LOG R, 0x40004000, 0x8, 0x0;
LOG R, 0x10001000, 0x8, 0x0;
LOG R, 0x00808000, 0x8, 0x0;
LOG R, 0x00001234, 0x8, 0x0;
LOG R, 0x00000001, 0x8, 0x0;

very thanks~
__________________
JoshuaChang is offline   Reply With Quote


Old Apr 29, 2011, 03:17 PM   #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!

Ответ: simulate the emu10kx's LOG instruct, need help

log r, 0x00012345, 0x7, 0; = 0x00123450
log r, 0x00001234, 0x7, 0; = 0x00012340
log r, 0x00000123, 0x7, 0; = 0x00001230
log r, 0x00000012, 0x7, 0; = 0x00000120
log r, 0x00000001, 0x7, 0; = 0x00000010
log r, 0x40004000, 0x8, 0; = 0x40000800
log r, 0x10001000, 0x8, 0; = 0x30000800
log r, 0x00808000, 0x8, 0; = 0x08080000
log r, 0x00001234, 0x8, 0; = 0x00012340
log r, 0x00000001, 0x8, 0; = 0x00000010

(I assume that you understand this C function is provided only for "educational" purposes and should never be used in real code (unless you're writing some emu10kx debugger) - it's inadmissibly suboptimal).
__________________
Max M. is offline   Reply With Quote
Old Apr 29, 2011, 05:59 PM Threadstarter Thread Starter   #3
HardwareHeaven Lover
 
Join Date: Mar 2003
Posts: 127
Rep Power: 0
JoshuaChang is on a distinguished road

Big Grin Re: simulate the emu10kx's LOG instruct, need help

wow~Max M!!, you saved my life, big thanks
__________________
JoshuaChang is offline   Reply With Quote
Old Apr 29, 2011, 11:34 PM   #4
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: simulate the emu10kx's LOG instruct, need help

since the dsp becomes an "old lady" simulating the whole instruction set would be great. we could use our plugins on every pc with asio output.
__________________
http://kxm.dyndns.org
stylus02 is offline   Reply With Quote
Old Apr 30, 2011, 05:11 PM Threadstarter Thread Starter   #5
HardwareHeaven Lover
 
Join Date: Mar 2003
Posts: 127
Rep Power: 0
JoshuaChang is on a distinguished road

Re: simulate the emu10kx's LOG instruct, need help

hey stylus02, i'm reading your superspace plugin, in your dsp code, is there any register/constant operand related to frequency? except the control lp_cut=1 and control lp_q=0.3?
__________________
JoshuaChang is offline   Reply With Quote
Old Apr 30, 2011, 11:06 PM   #6
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: simulate the emu10kx's LOG instruct, need help

now, you mean a control for tweaking the reverb color? there are only static delay times for early an late reverb. you can achieve a coloration over the delay feedback path (reverb decay time & damping (which is simply a lowpass structure)), but this is nothing special. a second lowpass filter affects generally the sound after the delayline. i gave it a feedback additionaly to get more basement. the late reverb is a duplicate of "freeverb" (open source). the sound itselve is very neutral.

https://ccrma.stanford.edu/~jos/pasp/img724.png

http://kxm.dyndns.org/superspace_03.jpg
__________________
http://kxm.dyndns.org

Last edited by stylus02; Apr 30, 2011 at 11:34 PM.
stylus02 is offline   Reply With Quote
Old May 1, 2011, 07:07 AM Threadstarter Thread Starter   #7
HardwareHeaven Lover
 
Join Date: Mar 2003
Posts: 127
Rep Power: 0
JoshuaChang is on a distinguished road

Re: simulate the emu10kx's LOG instruct, need help

thanks for the help.
i just want to use the superspace in 44.1khz environment, so any values related to times, frequency should be converted.
__________________
JoshuaChang is offline   Reply With Quote
Old May 1, 2011, 09:09 AM   #8
HardwareHeaven Addict
 
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0
stylus02 will become famous soon enoughstylus02 will become famous soon enough

Re: simulate the emu10kx's LOG instruct, need help

the delay times for comb- and allpassfilters were originally for 44,1 khz. i did no conversions to 48 khz (i had it in mind) because i liked the sound.

btw: if you use my delaylines in a 44,1 khz environment you are closer to jezars "freeverb". this could sound a bit "darker" i fear.
however, the freeverb was tweaked very well, to avoid resonance frequencies. it should sound allways "real".
__________________
http://kxm.dyndns.org

Last edited by stylus02; May 1, 2011 at 01:32 PM.
stylus02 is offline   Reply With Quote
Reply

Thread Tools