Old 10th April 2004, 11:27   #1
Synth-C
Junior Member
 
Synth-C's Avatar
 
Join Date: Aug 2003
Location: The Netherlands
Posts: 47
Cyclic Array

A little experiment with a cyclic array.
Attached Files
File Type: zip synth-c-cyclic_array.zip (984 Bytes, 234 views)
Synth-C is offline   Reply With Quote
Old 10th April 2004, 12:23   #2
D12
Banned
 
D12's Avatar
 
Join Date: Apr 2004
Location: Blood
Posts: 42
Send a message via ICQ to D12 Send a message via AIM to D12 Send a message via Yahoo to D12
There is black window, without any motion & color.
D12 is offline   Reply With Quote
Old 10th April 2004, 13:15   #3
Synth-C
Junior Member
 
Synth-C's Avatar
 
Join Date: Aug 2003
Location: The Netherlands
Posts: 47
You'll need Avs 2.81b
Synth-C is offline   Reply With Quote
Old 10th April 2004, 14:53   #4
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
you could optimize the whole thing a lot by using a cyclic buffer. that is, if you had 5 buffer entries you now do this

copy 3 to 4
copy 2 to 3
copy 1 to 2
copy 0 to 1
put new data into 0
use 0, 1, 2, 3, 4


using a cyclic buffer means you do the following:
bufnum=5

bufbase=(bufbase+1)%bufnum
use (bufbase+0)%bufnum, (bufbase+1)%bufnum, (bufbase+2)%bufnum, (bufbase+3)%bufnum, (bufbase+4)%bufnum

understood?
you save the copying time and shift the base index by +1 (the % is the modulo operation, which does a division and returns the rest

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 15th April 2004, 14:25   #5
Synth-C
Junior Member
 
Synth-C's Avatar
 
Join Date: Aug 2003
Location: The Netherlands
Posts: 47
Quote:
you could optimize the whole thing a lot by using a cyclic buffer. that is, if you had 5 buffer entries you now do this
Uhm, i used a cyclic buffer...

Just look at the (simplified) code;

per frame:
ww=80; points per ring
hh=100; amount of rings
fc=(fc+1)%hh; offset, your bufbase
loop(ww,exec2(assign( gmegabuf(cc+ww*fc),
(getosc((cc/ww),.1,0))) ,assign(cc,cc+1))); assign
getosc data for each point on the ring.

per point:
z1=gmegabuf((pc+fc*ww+ww)%n); retreive array data and
counter the offset.
pc=pc+1; pointcounter
Synth-C is offline   Reply With Quote
Old 15th April 2004, 15:10   #6
TomyLobo
Major Dude
 
TomyLobo's Avatar
 
Join Date: Feb 2004
Location: Germany
Posts: 580
oops i must have overread that, sorry

If you can't say something nice, say something surrealistic.
TomyLobo is offline   Reply With Quote
Old 16th April 2004, 21:43   #7
fragmer
Senior Member
 
fragmer's Avatar
 
Join Date: May 2003
Posts: 101
/me demands interactive 3d rotation "drag'n'drop" style :P
nice curves!
fragmer is offline   Reply With Quote
Reply
Go Back   Winamp & Shoutcast Forums > Visualizations > AVS > AVS Presets

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