Page 3 of 5

Re: PositionSyncedStepLFO - help?

PostPosted: Thu May 09, 2013 12:07 pm
by TrojakEW
quick look on asm and there are some changes. it can still be optimized more.
Code: Select all
//by nubeat7 may 2013
streamin barsIn;
streamin steps;
streamin timesigN;
streamin timesigD;
streamin PPQ;
streamin barstartHost;
streamout stepposition;

//float bars=0;
float beatsinbarsN=0;
//float beatsinbarsD=0;
//float barstart=0;
float barpos=0;
float rnd=0;
float F1=1;
// bars = xmm1
movaps xmm0,F1;maxps xmm0,barsIn;movaps xmm1,xmm0;

movaps xmm0,timesigN;mulps xmm0,xmm1;movaps beatsinbarsN,xmm0;

movaps xmm2,timesigD;mulps xmm2,xmm1;
//movaps beatsinbarsD,xmm0; = xmm2

movaps xmm1,barstartHost;divps xmm1,xmm2;movaps barpos,xmm1;

cvtps2dq xmm1,xmm1;cvtdq2ps xmm1,xmm1;
 
movaps rnd,xmm1;cmpps xmm1,barpos,6;movaps xmm0,F1;
andps xmm0,xmm1;movaps xmm1,rnd;subps xmm1,xmm0;
movaps xmm0,xmm2;mulps xmm0,xmm1;movaps xmm1,PPQ;
subps xmm1,xmm0;movaps xmm0,steps;divps xmm0,beatsinbarsN;
mulps xmm1,xmm0;movaps stepposition,xmm1;


Re: PositionSyncedStepLFO - help?

PostPosted: Thu May 09, 2013 2:01 pm
by Nubeat7
ah, thanks trojakEW, so like this, using more registers it is possible to eliminate4 cycles more and all variables (except F1) :) thats really great! slowly start to really like assambly :D

so here is the the latest optimized version
edit: check first file for latest version!

Re: PositionSyncedStepLFO - help?

PostPosted: Thu Jan 09, 2014 6:10 pm
by Father
Nubeat7 wrote:after finishing the code, this is the the finished version, from my point, notice that it only works correct in 4/4 atm! you can also find the codes for the "special rndint" to round streams down or up ....

This is the best syncing solution I've seen here that works solid. Thanks for sharing. However when bar set to less than 4 It doesn't loop the steps correctly, It keeps going 4bars then loops back to the beginning (fl studio).
I wanna make it a fixed 16 steps, and put a selector to change the speed from 1/32 to 4 bars. How can I do that?
Currently It plays my 16steps at the beginning of 4 bars then goes on and lopps back.

Re: PositionSyncedStepLFO - help?

PostPosted: Thu Jan 09, 2014 6:53 pm
by Nubeat7
you mean when bars set to less then 1 or?
did some more optimizations will have a look during next days when i`m back home..

Re: PositionSyncedStepLFO - help?

PostPosted: Thu Jan 09, 2014 8:01 pm
by Father
When the bar is 4, then it's perfect, after 4 bars it repeats the pattern, but when for example the bar is set to 2,in first two bars It plays the pattern twice as fast. then continues two more bars, after that comes back and repeats.
In 1bar, it's similar, 1 bar for steps, and 3 more bars.
strange behavior in bar=3! :D It gives it a nice triple rhythm, but It seems every time starts in +6 step position.
Thanks! I hope i can come up with something until then.

Re: PositionSyncedStepLFO - help?

PostPosted: Fri Jan 10, 2014 9:01 pm
by Nubeat7
i dont know why this is happening it only happens in Fruity loops, just tested in demo version works normal in renoise and cubase, afaik the host sync and timing works a little different in Fruity loops but i have no idea how to fix this? i think ihas something to do with the barcount, maybe it needs some wise words from FL users, i never used FL...

Re: PositionSyncedStepLFO - help?

PostPosted: Fri Jan 10, 2014 10:31 pm
by Nubeat7
after some investigation i found out that it is because of the bars n beats settings in fruity loops, it looks like FL is handling this different to the others, anyway original it is build for 4/4 and you get similar troubles when using 3/4 or something different in cubase

Re: PositionSyncedStepLFO - help?

PostPosted: Sat Jan 11, 2014 1:10 am
by Father
But this works so well, never looses the right position! It's so good not to fix it! :geek:
Can we set the bar to 4 (that works) and in order to get a shorter period, multiply the speed? or doesn't work that way at all?
I don't know why but It looks like the BarStart updates every 4 bar(16 beat), so it's, 0,16,32...etc. Isn't that suppose to update every 4 beat?

Re: PositionSyncedStepLFO - help?

PostPosted: Sat Jan 11, 2014 8:43 pm
by Nubeat7
BarStart updates every 4 bar(16 beat), so it's, 0,16,32...etc. Isn't that suppose to update every 4 beat?

yes the FL bar timing seems to be a bit confusing with that...

all in all the whole code is not a real good solution for special rythms different to 4/4..

this one should work fine it is a much simpler and i think more correct way, it should also work right when using 7/8 or 3/4 rythms, just did some fast testing on it..

please tell me if something is wrong with it.

edit: check first file for latest version!

Re: PositionSyncedStepLFO - help?

PostPosted: Sun Jan 12, 2014 2:03 am
by Father
Nice! you're a genius man!
I did some stuff on my own way, but not as clean and optimized as yours and still have some work to do.
This works really good! I couldn't find anything wrong with it, But i will study it and try some crazy situation later to make sure. I will let you know If there was a problem. So far It's pretty much perfect. 8-)
Thanks a lot!
Update: It worked with any time signature and step size i tried in fl studio. It's amazing how you calculated the step position in one line!