31st May 2003 07:31 UTC
Multi_DM
Just this new multi functional DM i created, was the easiest i ever did.
Would like to have your sugggestions to make it better.
Requires colormap.
Archive: Multi_DM
[Ishan]
31st May 2003 07:31 UTC
Multi_DM
Just this new multi functional DM i created, was the easiest i ever did.
Would like to have your sugggestions to make it better.
Requires colormap.
shreyas_potnis
31st May 2003 15:30 UTC
Well, yeah, the dm can be optimized to a great extent, especially the pixel part. What have you done here is:
x1=...
y1=...
x2=...
y2=...
...
and then
x=if(..,x1,x);
y=if(..,y1,y);
now suppose x1=sin(t)*x, suppose...
so directly you can write:
x=if(..,sin(t)*x,x); instead of calculating this and storing it in one variable. In this way only one out of 7 x's and y's are calculated.
and then instead of calculating above(bt,change)... per pixel, you can calculate it per-frame and then save it to one variable.
Here' the multi-flow dm base I created:
Init:
¤ Change this var : ;BEATSKIP=20; ¤Dont change this;NFEFFECTS=7;cb=rand(100)%NFEFFECTS;
Frame:
c0=equal(cb,0);c1=equal(cb,1);
c2=equal(cb,2);c3=equal(cb,3);
c4=equal(cb,4);c5=equal(cb,5);
c6=equal(cb,6);....go on adding this till the no. of flows you have
Beat:
cb1=(cb1+1)%BEATSKIP;
cb=if(bnot(cb1),(cb+1)%NFEFFECTS,cb);
Pixel:
¤ Flow 1;
r=if(c0,ADD STUFF HERE,r);d=if(c0,ADD STUFF HERE,d);
¤ Flow 2;
r=if(c1,ADD STUFF HERE,r);d=if(c1,ADD STUFF HERE,d);
¤ Flow 3;
r=if(c2,ADD STUFF HERE,r);d=if(c2,ADD STUFF HERE,d);
¤ Flow 4;
r=if(c3,ADD STUFF HERE,r);d=if(c3,ADD STUFF HERE,d);
¤ Flow 5;
r=if(c4,ADD STUFF HERE,r);d=if(c4,ADD STUFF HERE,d);
¤ Flow 6;
r=if(c5,ADD STUFF HERE,r);d=if(c5,ADD STUFF HERE,d);
¤ Flow 7;
r=if(c6,ADD STUFF HERE,r);d=if(c6,ADD STUFF HERE,d);
NEFFECTS stands for the number of flow patterns you are having.
Instead of r,d you can use x,y also. I know this can be reduced to just a couple of statements using nested if's, but that would be too confusing. If the no. of flow patterns are too large then you need'nt use c1,c2,c3...just use equal(cb,...) in the pixel part. Otherwise, there are changes that winamp would crash if the no. of variables is too large.
unripeLemon
31st May 2003 15:38 UTC
OOOOOOOOOOOOOOOOOOOH! (mouth watering) Thats realy nice:D a bit on the slow side though;)
[Ishan]
31st May 2003 15:54 UTC
Thanks unripelemon for the comments but i get around 20-30 fps on my comp, and shreyas must say your DM base is really good! I'l try and use it next time:up:
(but i really do find my DM very easy to use)
dirkdeftly
1st June 2003 05:38 UTC
undefined: alledgedly the if(a,b,c) statement calculates b and c regardless of a. so in all honesty i doubt there's much optimization you can do with those psuedoif statements. however there is something to be said about saving variables, which i believe decreases ram useage and is somewhat of a speedup (but what do i know)
as for the dm, multifunctional dm's (and scopes) have been around for a while - but it's still cool to get one to work yourself :)
[Ishan]
1st June 2003 06:46 UTC
yeah i guess it has been done many times before but i just wanted to make one myself that's it:)
S-uper_T-oast
2nd June 2003 04:22 UTC
I really like the way the dynamic move looks with those colors put over, but I like this more for the colors then the movements, some of the movements you get in this are good, but I still don't like how this worked out, I prefer fluid dynamic movements, not these "jittery" ones that change from preset movement to preset movement every N-beats, just a personal taste. Nice job with the all around coding though.
[Ishan]
2nd June 2003 09:02 UTC
So you say you dont like Multi DM's that change movement every N beats ??
Perhaps you like Dm's which change movements every M beats:p
Tuggummi
2nd June 2003 13:40 UTC
Pretty sweet preset, the code could be optimized a bit yes, but i doubt there is much you can do there, other than what shreyas already suggested.
btw. Using notepad to code multimovement dm's helps a lot ;)
Besides the multimovement, i really like the color trick here, it's pretty sweet :) Great work :up:
[Ishan]
3rd June 2003 07:28 UTC
Thanks i'm working on it to make it more customizable and nice, i post it here when it is done.
shreyas_potnis
4th June 2003 09:53 UTC
Just one question - in if(a,b,c) why is b calculated if a=0?
[Ishan]
4th June 2003 10:00 UTC
I thought that if(a,b,c) c is calculated if a=0,:eek:
sidd
4th June 2003 11:37 UTC
if(a,b,c) performs b if a<>0 and c if a==0
BUT, apparantly, (and i cant remember where this first came up) both b and c are calculated no matter what a is. This is because its not actually compiled language, its just text that is examined in and then used as instructions for the program.
Calculated does not mean performed, it just means that the code is run through even if it is not used.
Atero's comment meant that it doesnt save you any fps because avs still has to run through all of the code.
(btw, i dont actually know if this is the truth, i had heard of it vaguely before, and atero seems to have heard it aswell, but i dont know if its true.
Zevensoft
4th June 2003 16:05 UTC
You can reduce n=0 on SSC's per frame for optimizing.
Fork me on GitHub