Page 160 of 299

Re: lekt player

Posted: Fri Aug 01, 2014 2:17 pm
by jesuscheung
sbgk wrote:
jesuscheung wrote:i see why assembly code is needed for audio... getting sign of a number is complex already
you don't need to work out the sign, just multiply x by -1 each loop and add to d

loop1 d=0, x=640
loop2 d=640, x=-640
loop3 d=0, x=640

etc
your way looks better.

trying to imagine what it looks like in assembly... having a headaches...

------

this manifest works impressively with mqn.exe
can have a good effect on lekt.exe... but not as much
has a effect on mqnplay.exe... also not as much

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
<assemblyIdentity
version="1.0.0.0"
processorArchitecture="ia64"
name="mqn.exe"
type="win32"/>
<description></description>
<trustInfo xmlns="urn:schemas-microsoft-com:asm.v3">
<security>
<requestedPrivileges>
<requestedExecutionLevel level="requireAdministrator"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>

----
piano notes are definitely better. especially for fast notes

for piano- lekt2.97+this manifest > mqn2.82
emotion is less. but earaches is zero.

Re: lekt player

Posted: Fri Aug 01, 2014 2:32 pm
by lekt
sbgk wrote:is this better ? get's rid of the if then else. Also use waitforsingleobjectex.

x=-640

loop:
WaitForSingleObject(h,0xFFFFFFFF);
loaddata(d,...);

d+=x;
x=x*-1;
goto loop
best calculation is logical bitwise as >>, <<, &, |, ^ , don't use arithmetical operations *,/, they are most difficult for CPU. if/then with unsigned char also good (only compare >0 or !=0).
i^=1;if(i>0)d-=640;else d+=640; // 2 variables i and d, i is 1 byte, unsigned. 640 is constant
vs
d+=x;x=x*-1; // 2 variables, x is signed short 2 bytes. signed not good as unsigned. operator * is bad. x isn't constant.

not sure, you need test SQ in each case.

Re: lekt player

Posted: Fri Aug 01, 2014 3:31 pm
by sbgk
lekt wrote:
sbgk wrote:is this better ? get's rid of the if then else. Also use waitforsingleobjectex.

x=-640

loop:
WaitForSingleObject(h,0xFFFFFFFF);
loaddata(d,...);

d+=x;
x=x*-1;
goto loop
best calculation is logical bitwise as >>, <<, &, |, ^ , don't use arithmetical operations *,/, they are most difficult for CPU. if/then with unsigned char also good (only compare >0 or !=0).
i^=1;if(i>0)d-=640;else d+=640; // 2 variables i and d, i is 1 byte, unsigned. 640 is constant
vs
d+=x;x=x*-1; // 2 variables, x is signed short 2 bytes. signed not good as unsigned. operator * is bad. x isn't constant.

not sure, you need test SQ in each case.
I use neg in assembly which is a two's compliment instruction
x is an 8 byte register as it's used in the address calculation

Re: lekt player

Posted: Fri Aug 01, 2014 4:11 pm
by lekt
i remember used in old version:
x=-640;

loop:
d+=x;
x^=-256; // result 640, -640, 640,...
goto loop;

now code in C i don't directly add/substract pointer value (ie. don't use d+=640;), use only by bytes, 1st-byte of its 8-bytes, 2nd-byte,... sound have much vibration.

Re: lekt player

Posted: Fri Aug 01, 2014 7:06 pm
by sbgk
best calculation is logical bitwise as >>, <<, &, |, ^ , don't use arithmetical operations *,/, they are most difficult for CPU. if/then with unsigned char also good (only compare >0 or !=0).
i^=1;if(i>0)d-=640;else d+=640; // 2 variables i and d, i is 1 byte, unsigned. 640 is constant
vs
d+=x;x=x*-1; // 2 variables, x is signed short 2 bytes. signed not good as unsigned. operator * is bad. x isn't constant.

I'll try it, but still think it will have cmp and jmp instructions plus branch prediction issues.

if you put the pointer into a variable after the first get and then call get again and put that pointer into a variable then you don't need any arithmetic, just use the 2 pointer variables d=p1 then d=p2 etc.

Re: lekt player

Posted: Sat Aug 02, 2014 4:28 am
by lekt
jesuscheung wrote:
if(i>0)d-=640;else d+=640;
how about this:
d += ((i<0) - (i>0)) * 640;
interesting, many ways to resolve this. in your case compiler will include two if/then (i<0) and (i>0), one subtraction, one multiplication. and d will asign value in temporary variable containing last result of multiplication. not benefit, hehe...

for any number if need 2 value then always can find out xor number for it.
if a xor x = b then x = a xor b.
take a is 640, b is -640, we can find needed number for xor operator: x = 640 xor -640 = -256
and can do in loop x^=-256;d+=x;

can do more effective:

x=d^(d+640) // x declared as signed
loop:
d^=x;
goto loop;
(notice compiler don't let xor with pointer, need type casting.)

sbgk, i think it's best method.

Re: lekt player

Posted: Sat Aug 02, 2014 5:53 am
by lekt
uploaded v2.97.1 160

optimized code, replace some xor operators with asign = (one thing in loop ~ 100 things outside loop).
vibration much improved. try test other things.

Re: lekt player

Posted: Sat Aug 02, 2014 8:29 am
by jesuscheung
lekt wrote:uploaded v2.97.1 160

optimized code, replace some xor operators with asign = (one thing in loop ~ 100 things outside loop).
vibration much improved. try test other things.
no sound here.... nothing

Re: lekt player

Posted: Sat Aug 02, 2014 9:18 am
by jesuscheung
2.93 is weirdly good
that sound has feeling like ear whisper....
feels like honey moon...

is it a jitter or what? i just love it...
emotion is so strong, that, i have difficulty capturing the words/lyric

Re: lekt player

Posted: Sat Aug 02, 2014 9:20 am
by jesuscheung
i have strong feeling that the sound of 2.93 should be used on youporn... hehe