Old 16th June 2013, 20:50   #1
z33m
Junior Member
 
Join Date: Jun 2013
Posts: 22
Superscope: 'v' variable in frame code

Hi,

Im trying to figure out how some of the superscope codes work. Im checking
"Marco - science of superscope" preset from classic winamp presets list.

here is the code:

code:
init: n=800
frame: t=t-v*0.5
beat: t=t+0.3;n=100+rand(900);
point: d=D/n;r=(i-(t*3));
x=(atan(r+d-t)*cos(r+d-t+i));
y=((i+cos(d+v*1.2))-1.5)*1.7;
z=-(cos(t+i)+log(v)*cos(r*3))*3;
red=cos(r)+1;
blue=sin(r);
green=sin(i)/2



Here,
  1. what does the value of variable 'v' hold inside the frame section? I know it holds the spectrum data at point 'i' inside the point section, but what does it mean in the frame section?
  2. what is the variable 'D'?
  3. does the z variable actually do anything?
z33m is offline   Reply With Quote
Old 16th June 2013, 21:53   #2
QOAL
[STILL a retard!]
 
QOAL's Avatar
 
Join Date: Apr 2002
Location: Bristol, UK
Posts: 1,168
Open the (Settings -> )debug window and add reg00 = var; then you can watch the value, and see if it does anything. (reg goes from 00 to 99)

1:
I will take a guess at v being the same as i=0 at that point as it's ran before the point section.
In fact it does.
code:
frame:
reg00 = v;
point:
reg01 = if(equal(i, 0), v, reg01);


Both reg00 and reg01 show the same value.

I am an idiot and it's too late to be thinking. The code I tested was wrong, which I've now amended and it looks like they're different values. It's not equal to i=1 either.

2: Variables aren't case sensitive. (I can't remember if I knew that )
Example: D=1; d=0; reg02=D; (this will show 0)

3: Doesn't look like it, nope.

count!last.fmdastylishplanner
QOAL is offline   Reply With Quote
Old 16th June 2013, 22:54   #3
InCUbuS-94
Member
 
InCUbuS-94's Avatar
 
Join Date: Oct 2009
Location: Behind your house
Posts: 98
Well, "V" in this case is used to change the speed of the scope, and it's excecuted every frame, stating the obvious.

Z is useless, so go ahead, annihilate it.

It's 1 A.M. here and I'm tired, so my answer may not be what you're seeking.

It cannot rain forever
InCUbuS-94 is offline   Reply With Quote
Old 17th June 2013, 06:25   #4
z33m
Junior Member
 
Join Date: Jun 2013
Posts: 22
Quote:
Originally Posted by QOAL View Post
Open the (Settings -> )debug window and add reg00 = var; then you can watch the value, and see if it does anything. (reg goes from 00 to 99)

1:
I will take a guess at v being the same as i=0 at that point as it's ran before the point section.
In fact it does.
code:
frame:
reg00 = v;
point:
reg01 = if(equal(i, 0), v, reg01);


Both reg00 and reg01 show the same value.

I am an idiot and it's too late to be thinking. The code I tested was wrong, which I've now amended and it looks like they're different values. It's not equal to i=1 either.

2: Variables aren't case sensitive. (I can't remember if I knew that )
Example: D=1; d=0; reg02=D; (this will show 0)

3: Doesn't look like it, nope.
Thanks, didnt know how to use the debugger. This is really useful. still dont understand what v in frame code does. if i remove it the scope moves more uniformly and looks different.

Also the d=D/n; code doesnt do anything either since D was never initialized, will always be zero (im assuming this is the case, the debugger confirms: uninitialized variables are 0)

Quote:
Originally Posted by InCUbuS-94 View Post
Well, "V" in this case is used to change the speed of the scope, and it's excecuted every frame, stating the obvious.

Z is useless, so go ahead, annihilate it.

It's 1 A.M. here and I'm tired, so my answer may not be what you're seeking.
how does it control the speed? what values is assigned to it? is 'v' something provided internally by the Superscope?
z33m is offline   Reply With Quote
Old 17th June 2013, 09:12   #5
InCUbuS-94
Member
 
InCUbuS-94's Avatar
 
Join Date: Oct 2009
Location: Behind your house
Posts: 98
Using 'v' should be the same as using the getosc(), the only difference is that with the getosc function you can control more parameters (that is: band, width or channel)

For example:

code:
POINT
x=i*2-1;
y=v*0.5



is the same as
code:
POINT
x=i*2-1;
y=getosc(i,0.0,0)*0.5



That being said, with "control the speed" I mean you use a variable, called 't', where its value depends on 'v', and you use it on the point section to change the speed of the scope. It all depends where you put the 't'.

It cannot rain forever
InCUbuS-94 is offline   Reply With Quote
Old 17th June 2013, 17:20   #6
z33m
Junior Member
 
Join Date: Jun 2013
Posts: 22
I think value of 'v' maintains the last assigned value. ie. 'v' in frame section will be equal to last 'v' from the point section ie. when i = 1. I tried the following code

code:
init: n=800

frame: t=t-v*0.5;
reg01 = if(equal(reg00, v), 1, 0);

beat: t=t+0.3;n=100+rand(900);

point: d=D/n;r=(i-(t*3));
x=(atan(r+d-t)*cos(r+d-t+i));
y=((i+cos(d+v*1.2))-1.5)*1.7;
z=-(cos(t+i)+log(v)*cos(r*3))*3;
red=cos(r)+1;
blue=sin(r);
green=sin(i)/2
reg00 = v;



and reg01 shows up as 1 in the debug window.
z33m is offline   Reply With Quote
Old 17th June 2013, 17:51   #7
InCUbuS-94
Member
 
InCUbuS-94's Avatar
 
Join Date: Oct 2009
Location: Behind your house
Posts: 98
Ugh, that if statement is superfluous, at least use this
code:
reg01=equal(reg00,v)

It cannot rain forever

Last edited by InCUbuS-94; 17th June 2013 at 19:11.
InCUbuS-94 is offline   Reply With Quote
Old 17th June 2013, 18:42   #8
Warrior of the Light
Forum King
 
Warrior of the Light's Avatar
 
Join Date: Aug 2002
Location: The Netherlands
Posts: 4,051
No need for debugging, the answer is rather low-tech.

When that preset was created, we didn't have a rand() function yet (AVS 2.5). We used the audio to generate random values.
In this case I assume (as I don't have the preset installed here) that v is used as a waveform and varies between -1 and 1. That means that t increases or decreases with that value. Today you'd have used something like t=t-(100-rand(200))*.005;

D and z are normal variables with no special meaning in a ssc

Looking more closely, d is never really used. It's set to be 0 like stated above, and its always added. Adding 0 does nothing. The preset would be the same without it.

Jesus loves you [yes, you] so much, he even died for you so that you will not need to die, but live forever
Warrior of the Light is offline   Reply With Quote
Old 24th December 2015, 03:42   #9
unsaved97
Junior Member
 
Join Date: Nov 2015
Posts: 15
1: When the spec data is collected, however in frame section, also collects spec data and moves to the music, same as t=t+getosc(1,0,1)*0.5
2: Values and variables are not case sensitive
3: /z, *z, -z, +z, sin(z), anything that uses (z), it does anything but in this preset, nope.
unsaved97 is offline   Reply With Quote
Reply
Go Back   Winamp & SHOUTcast Forums > Visualizations > AVS

Tags
superscope

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 On
HTML code is Off

Forum Jump