Page 1 of 1

Anyone here able to help me with ASM code?

Posted: Wed Sep 09, 2015 8:20 pm
by djbrynte
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;

________________________________

Re: Anyone here able to help me with ASM code?

Posted: Wed Sep 09, 2015 9:30 pm
by martinvicanek
djbrynte wrote:I want it to work in grey lines. Not poly.

Johan, what do you mean by "grey lines"? I know stream (blue lines), poly (white lines), MIDI (red), graphics (yellow) and of course green lines. Grey lines are incactive . :?: :?

Re: Anyone here able to help me with ASM code?

Posted: Wed Sep 09, 2015 10:26 pm
by adamszabo
Maybe he means busses (grey)? I dont know

Re: Anyone here able to help me with ASM code?

Posted: Thu Sep 10, 2015 7:56 am
by djbrynte
Sry i mean. Blue lines = FX part (poly) Grey lines = Other synth part (Mono)

Im trying to make this chorus in grey lines. I mean so its not an FX. This is for a mono chorus.

I need to get it working :/ So i can reduce cpu.

Or im wrong mybe this code doesent matter for that?

Re: Anyone here able to help me with ASM code?

Posted: Fri Sep 11, 2015 8:07 am
by martinvicanek
Still not sure what you mean. :?
1. Quad Osc2 will work both in poly and stream.
2. Stereo Pack will only work in stream, not in poly (it does not make any sense in poly).
3. "I think Delay" - no, it is a stereo chorus mixer. Will work both in stream and poly (should you really want to use it there).
All three modules are very low CPU, there is nothing to be gained trying to optimize further.