Announcement

Collapse
No announcement yet.

Superscope: 'v' variable in frame code

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • 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?

  • #2
    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.fmplanner

    Comment


    • #3
      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

      Comment


      • #4
        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)

        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?

        Comment


        • #5
          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

          Comment


          • #6
            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.

            Comment


            • #7
              Ugh, that if statement is superfluous, at least use this
              code:
              reg01=equal(reg00,v)
              Last edited by InCUbuS-94; 17 June 2013, 19:11.
              It cannot rain forever

              Comment


              • #8
                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

                Comment


                • #9
                  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.

                  Comment

                  Working...
                  X
                  😀
                  🥰
                  🤢
                  😎
                  😡
                  👍
                  👎