Old 7th October 2002, 00:24   #1
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Unhappy Code trouble

I've made a sort of animation where 9 points move around the screen by waiting for their current movement to finish, then waiting for a beat then commencing their next movement. I've attached the preset because it is kind of hard to explain. Anyway, my problem is that I want the points not to wait for the next beat but to wait 4 beats before they shuffle around again, I've tried coding this in varying ways but each time I have completely failed. The nearest I got is also attached, it seems to work fine for a while then seemingly at random the points suddenly jump to their next positions rather than smoothly moving to them. Once again it is sort of hard to describe so please look at the preset.

This problem has been bugging me all day now so I thought that maybe one of you could spot what I've done wrong. The code is all fairly simple so I've most likely made a tiny error somewhere and I just can't spot it. I can't see why the random jumping occurs at all.

In the presets I've used the convolution filter to make the points more visible, if you don't have it don't worry, it's not vitally important to it in anyway.

Thanks in advance.
Attached Files
File Type: zip moving points.zip (1.4 KB, 201 views)

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 7th October 2002, 11:44   #2
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
Ummh I am confused as why if you want it to move every 4 beats you also want the code to finished processing. I can understand for every beat but why for 4 beats? Surly this wil just slow things down and the veiwer will not notice any difference.

Or am I missunderstanding totally here?

I presume that every 4 beat you want all the dots to move?

I think that the 'waiting for the code to finsh' bit is confusing is processing then you do the counting. Maybe dunno..

MAke it simple first. Use 1 dot instead of 9. I picked dot 2.

ANd make the number of steps 2 instead of 8 and add them slowly.

I will see if I can get any more for you.

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 7th October 2002, 12:45   #3
Rovastar
Moderator
 
Join Date: Jun 2001
Location: London, England
Posts: 3,632
Send a message via AIM to Rovastar
OK looked into the beat stuff and getting the counter is easy.

I made a very simple counter by

init
bc=0; (that's Beat Counter)
mo=0; (that's MOvement)

per_frame
bc=if(b,bc+1,bc);
bc=if(equal(bc,8),0,bc);
mo=if(equal(bc,1),1,0);

per_pixel
x=0.2*mo;
y=0.2*mo;

(I know it can be made better with the 2 lines for bc but for the basis of this it is as soimple as possible)


Now this works fine.

But I don't know if I misunderstand the way AVS works or something but if you double up these scopes using the same variable the preset goes made but using new variables for bc and mo it works fine.

Anyone care to explain?

Anyway here are the presets one works I would expect (2 sets of different variables) the other does not (thw same variables).

There are 3 points 1 just is the beat (as I do not know of a monitor function/APE in AVS I cannot see what is going off)

The other 2 points move every 8th (i think) beat. In the 'broken' one it 'robs' the beat from the other scope it seems.

So it seems you have to use a seperate variable for each scope or am I missing something.
Attached Files
File Type: zip test.zip (791 Bytes, 145 views)

"Rules are for the guidance of wisemen and the obedience of fools"

Visuals - Morphyre www.Morphyre.com
Rovastar is offline   Reply With Quote
Old 7th October 2002, 14:38   #4
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
It turns out that I has made an idiot simple mistake. The on beat code that reads bc=if(rate,bc,bc+1); should have been bc=if(rate,0,bc+1); .

D'oh!

Feel free to slap me for my stupidity.

I've attached the working version in case any one wants to steal the code and alter it to make their own moving points/objects 'animations'.

EDIT: The code can be cleaned up a bit, there is at least one redundant statement in there.

EDIT 2: Rovastar, I wanted to make them move every four beats because these points are going to be base points for reactive 3d objects, I just thought that it would be mega cool if they changed formation every now and again.
Attached Files
File Type: zip base points temp2.zip (754 Bytes, 159 views)

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 7th October 2002, 15:12   #5
Jaheckelsafar
Major Dude
 
Join Date: Feb 2002
Location: home
Posts: 1,318
*slap*

Stoke me a clipper. I'll be back for Christmas.

- Arnold Rimmer
Red Dwarf
Jaheckelsafar is offline   Reply With Quote
Old 15th October 2002, 07:15   #6
Tuggummi
Bin King
 
Tuggummi's Avatar
 
Join Date: Mar 2001
Location: Finland
Posts: 2,179
*slaps Jheriko*
Even I have managed to do a counter (i used it on the multimovement dynamoves on generation x)

And i don't even know how to code



But im glad the problem is solved already

Texer Resources

Im retarded... err i mean retired!
Probably both...
Tuggummi is offline   Reply With Quote
Old 15th October 2002, 09:06   #7
Montana
Major Dude
 
Montana's Avatar
 
Join Date: Dec 2001
Location: Södertälje, Sweden
Posts: 1,058
Send a message via ICQ to Montana Send a message via AIM to Montana Send a message via Yahoo to Montana
jheriko, i used that fixed version of that preset and made it more disco, i did it just for fun, hop you like it
Attached Files
File Type: zip base points temp2_1.zip (923 Bytes, 161 views)

batman
Montana is offline   Reply With Quote
Old 15th October 2002, 09:18   #8
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Hehe.. cool mix Montana. That beaming light effect is really disco

You'll have to wait a few days to see what I ended up using the points for

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 15th October 2002, 10:55   #9
Montana
Major Dude
 
Montana's Avatar
 
Join Date: Dec 2001
Location: Södertälje, Sweden
Posts: 1,058
Send a message via ICQ to Montana Send a message via AIM to Montana Send a message via Yahoo to Montana
oh, can i put my mix of the temp preset in my forthcoming pack, you will get full credit for the scopes

batman
Montana is offline   Reply With Quote
Old 15th October 2002, 11:01   #10
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Yeah, go for it. I'm glad to know that someone else found a good use for them.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 17th October 2002, 03:43   #11
Karnov
Senior Member
 
Karnov's Avatar
 
Join Date: Aug 2002
Location: Narok<Where I live<Valhalla
Posts: 165
*slap*
damn you and your math/logic skills


Karnov is offline   Reply With Quote
Old 17th October 2002, 06:56   #12
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
If anyone is interested these points were used as the basis for my bluespectrum remix for the el-vis tribute pack.

http://www.deviantart.com/deviation/796550

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 21st October 2002, 06:27   #13
geozop
Member
 
Join Date: Jul 2001
Location: Livermore, CA
Posts: 63
Send a message via ICQ to geozop Send a message via AIM to geozop Send a message via Yahoo to geozop
what about

misc -> Custom BPM?

If you don't want it to change the rest of your visualization, put it and the scopes in their own effect list.
geozop is offline   Reply With Quote
Old 21st October 2002, 12:59   #14
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
That wouldn't have worked because i needed to make the scopes finish their movements *then* wait for those beats. Using 'Custom BPM' would not wait 4 beats after the scopes have moved, but rather only give them one beat in the time that there would normally be 4, so if the scope took 4 beats to move they would constantly move, or if the took 2 then they would only wait 2.. etc, resulting in varying results for every track.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Old 21st October 2002, 14:43   #15
UnConeD
Whacked Moderator
 
UnConeD's Avatar
 
Join Date: Jun 2001
Posts: 2,104
Alternatively, you use something like this:
(tx/y = target point, px/y = current point)

onbeat:
foo=below(sqrt(sqr(tx-px)+sqr(ty-py)),.05);
tx=if(foo,new-point,tx);
ty=if(foo,new-point,ty);

This would make a point shift around onbeat as soon as they have nearly completed their movement.

Oh by the way, a shorter counter is:
bc = (bc+1)%8


UnConeD is offline   Reply With Quote
Old 21st October 2002, 14:50   #16
jheriko
Forum King
 
jheriko's Avatar
 
Join Date: Aug 2002
Location: a twist in the fabric of space
Posts: 2,150
Send a message via ICQ to jheriko
Ignore my stupidity on the % issue, I realised that after I submitted that preset.

I like my current method of making them move around though, mainly because its easier for me to visualise in my head how it works.

-- Jheriko

'Everything around us can be represented and understood through numbers'
jheriko is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS > AVS Troubleshooting

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump