|
|||||||
![]() |
|
|
Thread Tools |
|
|
#1 |
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
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;
}
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~
__________________
|
|
|
|
|
|
#2 |
|
h/h member-shmember
Join Date: Dec 2002
Location: Evil Empire
Posts: 2,639
Rep Power: 69 ![]() ![]() ![]() ![]() ![]() ![]() |
Ответ: 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).
__________________
|
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
wow~Max M!!, you saved my life, big thanks
__________________
|
|
|
|
|
|
#4 |
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
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.
|
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
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?
__________________
|
|
|
|
|
|
#6 |
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
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 Last edited by stylus02; Apr 30, 2011 at 11:34 PM. |
|
|
|
|
|
|
|
HardwareHeaven Lover
Join Date: Mar 2003
Posts: 127
Rep Power: 0 ![]() |
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.
__________________
|
|
|
|
|
|
#8 |
|
HardwareHeaven Addict
Join Date: Jan 2008
Location: germany, sb0090
Posts: 259
Rep Power: 0 ![]() ![]() |
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". Last edited by stylus02; May 1, 2011 at 01:32 PM. |
|
|
|
![]() |
| Thread Tools | |
|
|