Anyone here able to help me with ASM code?
Posted: Wed Sep 09, 2015 8:20 pm
I have an LFO and Delay.
I want it to work in grey lines. Not poly.
Here is the codes.
1. Quad Osc2
streamin kin;
streamout x;
streamout y;
float k1=0;
float k2=0;
float F0=0;
float F1=1;
float FM2=-2;
stage0; // initialize x=0 and y=1
movaps xmm0,kin;
mulps xmm0,xmm0;
addps xmm0,F1;
movaps xmm1,kin;
divps xmm1,xmm0;
addps xmm1,xmm1;
movaps x,xmm1;
movaps xmm0,F1;
mulps xmm1,kin;
subps xmm0,xmm1;
movaps y,xmm0;
stage2;
// update coeffs (hop)
mov eax,ecx;
and eax,31;
cmp eax,0;
jnz end0;
movaps xmm0,kin;
movaps k1,xmm0; // assign k1
mulps xmm0,FM2;
movaps xmm1,k1;
mulps xmm1,k1;
addps xmm1,F1;
divps xmm0,xmm1;
movaps k2,xmm0; // assign k2
end0:
// iterate
movaps xmm0,k1;
movaps xmm1,k2;
mulps xmm0,x;
addps xmm0,y; // store tmp in xmm0
mulps xmm1,xmm0;
addps xmm1,x;
movaps x,xmm1; // assign x
mulps xmm1,k1;
addps xmm1,xmm0;
movaps y,xmm1; // assign y
________________________________
2. StereoPack
streamin in0;
streamin in1;
streamout pack;
movaps xmm0,in0;
movaps xmm1,in1;
shufps xmm0,xmm1,68; // ABxx,CDxx -> ABCD
movaps pack,xmm0;
___________________________
3. I think Delay
streamin in;
streamin chorusL;
streamin chorusR;
streamin mix;
streamout outL;
streamout outR;
float F1=1;
float FP5=0.5;
movaps xmm2,mix;
movaps xmm0,chorusL;
mulps xmm0,xmm2;
subps xmm0,in;
movaps xmm1,chorusR;
mulps xmm1,xmm2;
subps xmm1,in;
mulps xmm2,FP5;
subps xmm2,F1;
mulps xmm0,xmm2;
movaps outL,xmm0;
mulps xmm1,xmm2;
movaps outR,xmm1;
________________________________
I want it to work in grey lines. Not poly.
Here is the codes.
1. Quad Osc2
streamin kin;
streamout x;
streamout y;
float k1=0;
float k2=0;
float F0=0;
float F1=1;
float FM2=-2;
stage0; // initialize x=0 and y=1
movaps xmm0,kin;
mulps xmm0,xmm0;
addps xmm0,F1;
movaps xmm1,kin;
divps xmm1,xmm0;
addps xmm1,xmm1;
movaps x,xmm1;
movaps xmm0,F1;
mulps xmm1,kin;
subps xmm0,xmm1;
movaps y,xmm0;
stage2;
// update coeffs (hop)
mov eax,ecx;
and eax,31;
cmp eax,0;
jnz end0;
movaps xmm0,kin;
movaps k1,xmm0; // assign k1
mulps xmm0,FM2;
movaps xmm1,k1;
mulps xmm1,k1;
addps xmm1,F1;
divps xmm0,xmm1;
movaps k2,xmm0; // assign k2
end0:
// iterate
movaps xmm0,k1;
movaps xmm1,k2;
mulps xmm0,x;
addps xmm0,y; // store tmp in xmm0
mulps xmm1,xmm0;
addps xmm1,x;
movaps x,xmm1; // assign x
mulps xmm1,k1;
addps xmm1,xmm0;
movaps y,xmm1; // assign y
________________________________
2. StereoPack
streamin in0;
streamin in1;
streamout pack;
movaps xmm0,in0;
movaps xmm1,in1;
shufps xmm0,xmm1,68; // ABxx,CDxx -> ABCD
movaps pack,xmm0;
___________________________
3. I think Delay
streamin in;
streamin chorusL;
streamin chorusR;
streamin mix;
streamout outL;
streamout outR;
float F1=1;
float FP5=0.5;
movaps xmm2,mix;
movaps xmm0,chorusL;
mulps xmm0,xmm2;
subps xmm0,in;
movaps xmm1,chorusR;
mulps xmm1,xmm2;
subps xmm1,in;
mulps xmm2,FP5;
subps xmm2,F1;
mulps xmm0,xmm2;
movaps outL,xmm0;
mulps xmm1,xmm2;
movaps outR,xmm1;
________________________________