Winamp & Shoutcast Forums > AVS Solid SSC

 10th May 2002, 10:48 #1 EL-VIS2 Member   Join Date: Jan 2002 Location: Germany Posts: 73 Solid SSC "How to do a solid Superscope (with color gradients)?" Since I received this question via e-mail three or four times during the last weeks I decided to post this one here: --------------------- Whats helpfull with tries to fill larger areas of the screen is the length of one pixel in screen-coordinates. This is for width wpix = 2 / w and for height hpix = 2 / h To fill an horizontal SSC all you need is to draw a line to a music value in y then make the next point go one pix right on x and back down to zero on y and then go for the next music value and so on. So every music value needs two points to be completed which leads to n = w * 2 All values need to be set in FRAME since they are affected by changes in screen-resolution i.e. by switching from windowed to fullscreen mode. All we need now is a switch which makes the two steps ( music value and then back to zero ) happen ( ct in the following example ). Gradients in a SSC simply could be achieved by using the sine of i on setting the colors. So here's the complete basic solid-gradient-SSC setup: FRAME: wpix = 2 / w ; n = w * 2; xp = -1 ; ct = 0 ; fr = fr + 0.02 POINT: ct = bnot ( ct ) ; vv = if ( ct , getosc (i , 0.1 , 0 ) , 0 ) ; xp = if ( bnot ( ct ) , xp + wpix , xp ) ; x = xp ; y = vv ; red = abs ( sin ( i * 2 + fr ) ) ; green = abs ( sin ( i * 3 + 2 * fr ) ) ; blue = abs ( sin ( i * 4 + 3 * fr ) ) The look of the SSC is changed by manips of the second line in point. Check out these for example: vv = if ( ct , getosc (i , 0.1 , 0 ) , - vv ) ; vv = if ( ct , - getspec (i , 0.1 , 0 ) , 0 ) ; vv = if ( ct , getspec (i , 0.1 , 0 ) , - vv ) ; The gradient here is very simple. To make it more random you may wish to setup some beat reaction like this: BEAT: b1 = rand ( 20 ) / 100 - 0.1 ; i1 = rand ( 6 ) ; FRAME: f1=f1+b1 POINT: red = sin ( i * i1 + f1) Have fun in experimenting with this basic setup.
 10th May 2002, 11:11 #2 EL-VIS2 Member   Join Date: Jan 2002 Location: Germany Posts: 73 Sorry, realized too late that there is already a threat on this started by montana38. So I tried to delete this here and add it to Montanas thread but access to deletion was denied...
 12th May 2002, 23:52 #3 dirkdeftly Forum King     Join Date: Jun 2001 Location: Cydonia, Mars Posts: 2,651 I think a couple of things in this post can be misleading. First of all, the maximum number of v returns is 576. Any more will extend v slightly when i=1 (adding a 'tail'). Also, I think that calling a function rather than using an operator is a bit slower; bnot(a) can be replaced with 1-a. Umm...I think that's all (for now) "guilt is the cause of more disauders than history's most obscene marorders" --E. E. Cummings
 13th May 2002, 08:00 #4 EL-VIS2 Member   Join Date: Jan 2002 Location: Germany Posts: 73 Ok, I see the little tail but only with getspec... What helps is perhaps stopping i before getting close to 1: vv = if ( ct , - getspec (i * 0.9 , 0.1 , 0 ) , 0 ) ;
 13th May 2002, 08:51 #5 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 I found this out a while ago: 'render > simple' only draws the first 100 of the 288 samples. For the spectrum this is okay, because the higher frequencies tend to be low, but there's no reason to do it for the oscilloscope.
 13th May 2002, 09:41 #6 goebish Senior Member     Join Date: Feb 2002 Location: an UFO near planet earth Posts: 164 288 samples I'll try to write an simple.ape that display all 288 samples instead of 100...I'm not a very good avs maker, but maybe that will help you...
 13th May 2002, 18:51 #7 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 I wrote an ape for that a while ago, but I never released it. I wrote it as a short test for my C implementation of getspec and getosc... I noticed AVS showed a lot less data than mine, and figured it out. It's not that bad though and nobody's noticed up until now.
 16th May 2002, 13:20 #8 EL-VIS2 Member   Join Date: Jan 2002 Location: Germany Posts: 73 Hmm, my setup is a little bit complicated ( I tend to use if-constructions even if there's a more math-way to do it). Here is a more simple and faster way to do the thing I saw in a preset made by AVS-King ( David Hansen ). AVS-KING FRAME: n=w*2 POINT: x=(i*2-1); s=bnot(s); y=getosc(i,0.03,0)* s; or for a mirrored scope: y=getosc(i,0.03,0)*(1-2*s);
 17th May 2002, 12:22 #9 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 For mirrorred bouncing to fill a solid SSC, I tend to use 'var=-var' and initialise it to '1'. That's probably faster than (s*2-1) and bnot.
 17th May 2002, 21:17 #10 Montana Major Dude     Join Date: Dec 2001 Location: SÃ¶dertÃ¤lje, Sweden Posts: 1,058 i use this base for solid scopes: init: n=w;t=0=acos(-1); frame: t=t+.1; pixel: s=1-s; x=i*2-1; y=s*2-1; this will give you a "fullscreen" solid superscope ok, here's the problem, i've noticed that the "solid scopes" isn't as solid when you use i*2-1 or whatever, iuf you use the base i use then you'd see some one pixelline spaces, that's because the "solid ssc" are spirals and you don't notice if you don't multiply i with a variable/number but if you multiply it and you see this spiral. a way to fake fullscreen is this superscope init: n=w;t=0=acos(-1); frame: t=t+.1; pixel: s=1-s; x=i; y=s*2-1; and a r2l mirror. (ok, thing i said is kinda known by others, but just want to state the probs with solid superscopes) batman
 18th May 2002, 11:00 #11 EL-VIS2 Member   Join Date: Jan 2002 Location: Germany Posts: 73 Pixellines I do not get pixelines at all. I think what's important is to set n = w * 2 and do this in FRAME to make shure n is always twice the screen width. It is important to do this in FRAME and NOT in INIT since INIT is only done once on startup and then never again even if the user switches from windowed to fullscreen mode which may differ in width.
 12th January 2004, 10:36 #12 l TylerDurden l Junior Member   Join Date: Jan 2004 Location: Warsaw Poland Posts: 1 Yeah! I've finally found the thread I was looking for. I had been trying to make a ssc which would look like the solid simple spectrum render but have faild due to my stupidity and lack of experience Now... I've tested every solution posted here: they are grate, unfortnately don't work the way I'd like them to. Ok what I mean is: if I set render mode to 10 pixels and add a solid simple spectrum render it looks quite nice. But that doesn't seem to work with any of the examples posted in this thread. What I get this blocky type simple (which I'm aiming for) but every block is finished with a short, thin line (which I am not aiming for ) Is there a way of getting rid of it? Thanks of any kind of reply.
 12th January 2004, 10:43 #13 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 Note that this thread is a bit outdated. You can probably do more effecient solid scopes using the newer AVS features like skip. Many of the optimization tips in code here are also not valid anymore due to changes in evallib behaviour. I suggest you post your preset in a new thread so people can look at it.
12th January 2004, 12:30   #14
shreyas_potnis
Major Dude

Join Date: Jan 2003
Location: Mumbai, India
Posts: 787
You can also use this. Its incomplete, but I will fix it up when I get some time.
Attached Files
 linewidth.zip (21.8 KB, 313 views)

http://home.iitb.ac*****~shreyaspotnis

 12th January 2004, 12:48 #15 Yathosho Forum King     Join Date: Jan 2002 Location: AT-DE Posts: 3,366 i think you should fix it before you post it
 12th January 2004, 13:52 #16 UnConeD Whacked Moderator     Join Date: Jun 2001 Posts: 2,104 Err shreyas, you do know that a linewidth variable was added to AVS?
 Winamp & Shoutcast Forums > AVS Solid SSC