Visualnoobs Website

Creator’s Email

Creator’s Gallery

Winamp Forums

Visualnoobs AVS Tutorial. V1.0

Welcome to the first official Visualnoobs avs programming tutorial.

We are here to help you learn the wonderful and fascinating world of avs and its personal language.

The avs language can seem a little overwhelming for one reason, its very mathematical, because of this you need and in some cases knowledge of 3 advanced kinds math. The mathematics you need to are, Trigonometry, Geometry, and basic algebra.

Because of this reason, we provide this tutorial to give you a simple way of learning avs without the knowledge in those mathematical areas.

To start using this guide all you do is open the avs visualization window, right click and select avs editor and then click presets and click new and disregard everything that needs to be saved.

Now go to the button at the top left hand corner that looks like this + and click it, inside there are menu options, Presets, Render APE, Virtual Effect, Misc., Trans, Render, and Effect List. Now go to the menu for Render in the + button and click Superscope.

Wow what just appeared on the avs visualization window. Is that a spiral spinning and dancing to the music.

Ok now the setup for the Superscope is like this.

The Superscope runs on a variable and value set up like this. Where x= the variable and .1 would be your value and it should look something like this x=.1 now because I too am a noob but don‘t be fooled I know enough to make this tutorial. A easier way of learning what each thing I say for you to do is to use the expression help button. There it will have a very accurate explanation of each function, constant, values, and operators.

This here is the way most of the programmable avs modules will look like.

Int.

Frame

Beat

Point

Now here we put the codes to control what the Superscope does.

Allow me a brief moment to explain the purpose of a Superscope.

Basically for those who have used a graphing calculator like a TI-83 then the Superscope would make more sense to you. But for those who don’t know what it is here’s an explanation.

The Superscope is in its own right a drawing tool that uses a variable to value system

The Superscope is used to render dots or lines depending on the setting called dot/lines on the bottom right hand corner of the Superscope editor. the variable n= is the variabnle you use to control how many points you want example would be like this n=800, that’s the basic default for all scopes, when you use this n=800 would mean it is rendering 800 points. Each point is then identified by a set of unique variables called x= and y=, these variables are programmed as a coordinates variable in the trigonometry standard or 1 to -1 for x and y.

X meaning the horizontal position and Y meaning the vertical. Now here’s something try typing. Exclude the int., frame, beat and point and only type what comes after them in their corresponding boxes.

Int. n=800

Frame

Beat

Point. X=I-0.5;Y=v*0.5;

Now if you can see a oscilloscope then you made your first handmade preset.

Ok now for a experiment. Change the n=800 to n=5. Neat huh. As you noticed the oscilloscope became less impressive. that’s because as stated above you just lowered the amount of points available to the oscilloscope. Because there are only five points there are only 5 lines but when set to 800 there are 800 points thus 800 lines and that’s what makes the scope look better. Now there are some limitations the amount of points you can use. Basic rule of thumb is to never go over more then 1000 points for any preset unless its really needed. Because it takes up more memory to calculate 1000 points then it does to calculate 500. Also another thing to not do is to use if it at all possible to avoid is the use of arbitrary numbers because. Computers have a easier time calculating 150 then 137 or 465 to 500. Get the point. Ok now to another nice little doodad. The Texer II render object.

 

 

The Texer uses the same exact coding language and variables to program it like the Superscope does except this has the ability to use bmp images as the points for your render. Now here’s the only difference. The variable n= is not just associated with making points for lines also the number you use will mean how many images you want to have in use for you scope. Now as in the last example do the same in the point region of the Texer II and use n=300 instead of n=800.

Example 2

Int. n=300;

Frame

Beat

Point x=I-0.5;y=v*0.5;

Another nifty trick you can do with the language of avs is include your own comments on the code for example

Int. n=300 // Int is calculated once when avs is started

Frame /* Frame is used when you want to calculate something per frame

That way you can make simple animated movement like moving around the screen or spinning, more on that part next */

Beat

Point

The // is used for when you would like to use short statement of what your code does.

The /* and */ are used when you want to comment an entire paragraph.

The frame region is a very important area to learn if you want to be successful with avs. The frame region is a place where your codes are calculated per frame instead of just once. Frame is used when you want to calculate movement or camera like functions, even 3d if you’d like.

A simple way of doing this is using t=t-0.05; very handy for when you want to make a sin wave animate.

The beat region is used specifically if you want a transformation or a rotation done on beat then program in the frame or point something like this

frame t=t-0.05*beatrot;

Beat beatrot=rand(10)/117; /*now I know I said no arbitrary numbers right well in this case the random number will now be in the hundredths instead of the tenths like this 0.0854700854700854700854700854700855 instead of 10.00 this way you get random number between 1 and 0.0854700854700854700854700854700855 and trust me that really comes in handy */

Int as you might already now is short for Initialization meaning that when the preset is loaded then all variables and their values are loaded and calculated only once per time the preset is loaded.

Now there is a very useful ability of avs where you can control a point or picture depending on where you program this in.

In the Superscope type

Int. n=2;

Frame

Beat

Point x=getkbmouse(1);y=getkbmouse(2);

The getkbmouse(1) and getkbmouse(2) are the mouse control

Number 1 being for the x position of the mouse and 2 for the y position of the mouse. After you apply the codes I provided above you will see single dot moving around wherever your mouse goes p.s. only works if the dot render at the bottom right hand side of the Superscope screen is selected.

Now take that code and apply it to the Texer II module but change the n=2 to n=1 that way your only rendering one picture instead of two.

Now your prolly getting tired of hearing me babble right. Well if you are then close this document and go find a better tut. Heh just kidding. Anyway now we move on the fun stuff.

Global Variables can be very handy indeed. The reg function comes in handy for when you want to sync two scopes together.

Example. Copyright notice this example is borrowed from Pak-9’s AVS programming guide which is better then this one.

Insert this into a superscope

Int. n=2;

Frame Xpos=reg00;

Drawmode=2;

Beat

Point X=Xpos; Y=2*i-1;

 

 

Now create a Texer II and use

Int. n=1

Frame pos1=pos1+speed1;

pos2=pos2+speed2;

Xpos=sin(pos1);

Ypos=sin(pos2);

Reg00=Xpos;

Beat speed1=rand(10)/100;

speed2=rand(10)/100;

Point X=Xpos;

Y=Ypos;

Now note how the line follows the dot and never leaves its center. Now in the options area of the editor there is a selection in the menu called debugger. Click it and you will notice there is a bunch of numbers changing at a high rate of speed. Well as a matter of fact your looking at the mathematical numbers of your dot moving across the screen. The reg00 or register can be programmed up to a additional 99 regs so that way you can use a infinite amount of values. Another good use for them is to use them to store your values. But you know I think I’ll pass you on to the final section of our Tutorial.

Making a circle. The base principle of a circle in a Superscope is more simple then one thinks.

Example

Int. n=100;

Frame

Beat

Point x=r*cos(a);y=r*sin(a);d=i; r=1;a=2*$pi*i;

With this code you can make a simple circle.

And for more fun add in the frame region asp=h/w;

And then in the point region x=x*asp; note for you is to not delete the other x code. Now try and resize your window with the visual on it. Notice how no matter how much you make smaller the circle some how shrinks with it and never leaves the edges.

That my friend is called aspect correction and it comes in real handy for when you have a certain effect that you scaled down but you want it to remain there and resize it self whenever the size of the window is changed.

Copyright notice this to is from the Pak-9 AVS Programming Guide.

Sinusoidal wave or sine wave is a very nice thing to have because they can be programmed for various things.

Int. n=500;

Frame t=t0.05;

Beat

Point x=2*i-1;

y=0.5*sin(2*$pi*2*x+t);

If you wish to learn more visit the win amp forums and go to the thread called avs and ask a question or two to see who would like to help you learn more on avs.

 

 

 

Credits.

Pak-9 for his wonderful Avs Programming Guide.

And my friends on the win amp forums who have gladly been helping me create visual noobs.

Warrior of The Light

Fastingaciu

Shreyas Potnis

ASD5A

Javs