Page 1 of 1
Poly - Bypass Code Section
Posted: Sun Mar 02, 2014 9:31 am
by Tronic
Trog had made in the past few modules, which perform the bypass section of code,
but they only work with mono signals.
No chance to do this in Poly?
The management of Poly afflicts me.
Re: Poly - Bypass Code Section
Posted: Tue Mar 04, 2014 5:15 pm
by KG_is_back
Poly section is computed similar to mono4, each 4 channels run new code channels (you can observe that while playing and adding notes, each 4 new notes added the CPU rises). Stage0 is computed for each channel separately (I think) in the moment it starts, then stages 1-3 are computed for each 4 notes as they run. I mean when you play one note and hold it it starts with stage0 and goes stage2 afterwards. when you add new note, it computes stage0 for the new note and code continues as second channel in stage2 that is allready running.
To create bypass in poly section per voice you'd have to write the code that each channel is computed separately and bypassed separately. That would make the code 4x as long (and cpu 4x as high). There is a way to overcome this problem by shuffling. Basically if you set one channel in poly stream to off it would compute all streams as normal, but for the one that is off it would copy the input to output (override the output) - that wpuld have no effect on CPU. If all 4 channels are off it would truly bypass the code.
Code: Select all
streamin in;
streamboolin bypass;
streamout out;
float F5=5;
stage2;
//check if bypass all channels
movaps xmm0,bypass;
movaps xmm1,xmm0;
shufps xmm1,xmm1,177;
andps xmm0,xmm1;
movaps xmm1,xmm0;
shufps xmm1,xmm1,12;
shufps xmm0,xmm0,3;
andps xmm0,xmm1;
movd eax,xmm0;
cmp eax,0;
jnz bypasscode;
///The code to bypass
movaps xmm1,in;
mulps xmm1,F5;
movaps out,xmm1;
/// end of code
bypasscode:
// bypass any channel
// code version: out=out+(in-out)&bypass;
movaps xmm0,bypass;
movaps xmm1,xmm0;
andps xmm0,in;
andps xmm1,out;
subps xmm1,out;
subps xmm0,xmm1;
movaps out,xmm0;
assembly version that bypasses output of every channel and bypasses the code execution of all sse channels are set to bypass
Re: Poly - Bypass Code Section
Posted: Wed Mar 05, 2014 5:12 pm
by Tronic
anyway thanks.
what I think would be a management for voice,
for example,
using an "execute code only if the value is changed", now it is difficult to apply in poly,
like you said, would not bring benefits with splitting the voices comparation check.
Re: Poly - Bypass Code Section
Posted: Wed Mar 05, 2014 6:20 pm
by KG_is_back
Above code is the closest you can get to that task