8 Replies Latest reply on Jan 5, 2010 10:49 PM by Mylenium

    generate sinewave with keyframed wavelength

    clayevans

      hello everybody!

       

      i would like to generate a sinewave with expressions. also i would like to keyframe the wavelenght from the value 20 to the value of 10.

       

      i have this code at the moment:

       

       

      frequence =(thisComp.layer("streakControl").effect("wavelength")("Slider");


      amplitude=10;

       


      x=amplitude*Math.sin(time*frequence);


      transform.position+[x,0];

       

      i set the keyframes for the slider "wavelength from 20 to 10 and after effects messes the graph up in the middle of the wavelength-transition.

       

      ist works if i change the "time" expression to Math.PI BUT after the keyframing no values changing and the sin equation returns always the same value so there just a flat line shows up. thats not what i want.

       

      image of the situation with drawn result by AE attached.

       

       

       

      any ideas?

       

      greets, clay

        • 1. Re: generate sinewave with keyframed wavelength
          Mylenium Most Valuable Participant

          How do you generate the wave drawing? You may see additional interpolation inbetween keyframes based on the plug-ins behavior.

           

          Mylenium

          • 2. Re: generate sinewave with keyframed wavelength
            TimeRemapper Level 4

            I know you mentioned wanting to do this with expressions, but if it suits your needs & you can't seem to work out the expression the way you need to, you could also do this using the tone generator effect combined with the audio waveform effect.

            1 person found this helpful
            • 3. Re: generate sinewave with keyframed wavelength
              clayevans Level 1

              thank you TimeRemapper, this is an interresting approach, i saved your file but i really would like to solve this "fundamental" issue by expressions because i think AE got enough power to to that job. also later on if this thing is clear ei would like to "draw" geometric and organic things with more then one line and therefor i need as much control as possible. but thx again!

              • 4. Re: generate sinewave with keyframed wavelength
                TimeRemapper Level 4

                Understood.

                 

                Have you looked at Dan Ebbert's site regarding the sin function?

                • 5. Re: generate sinewave with keyframed wavelength
                  clayevans Level 1

                  hey!

                   

                  to the bottomlayer "streak" is trapcode particular applied. no fancy stuff, just point emitter, directional emitting, no spread,and i subframe interpolation by particular, but with and without interpol. the problem stays.

                   

                  additionally there is a nullobject "streakcontrol" to manage the position of particular. particular is just linked with je pickwip, no weird thing.

                  to the nullobject is the code above applied. nothing else.

                   

                  i tried a seach at google, but this ended often with wiggle expressions so i try it here

                  • 6. Re: generate sinewave with keyframed wavelength
                    Mylenium Most Valuable Participant

                    to the bottomlayer "streak" is trapcode particular applied. no fancy stuff, just point emitter, directional emitting, no spread,and i subframe interpolation by particular, but with and without interpol. the problem stays.

                     

                    additionally there is a nullobject "streakcontrol" to manage the position of particular. particular is just linked with je pickwip, no weird thing.

                    to the nullobject is the code above applied. nothing else.

                     

                    Well, then it's as I said. You see normal interpolation. Particle properties are assigned at the time of emission and then evaluated over the particle's life cycle and the result you see is 100% correct in that regard. The setup is just unsuitable and you have it backwards. What you want to do would require it just to be the other way around - the emitter moves, particles have zero velocity, when you increase the Y velocity the wavelength expands. It will never be perfectly smooth inbetween, though. If you really must have perfect waves, use the approach Steve described or use efects such as Write-On to generate the lines. If you have Trapcode Form, another option would be audio effectors also modulated with a suitable input tone.

                     

                    Mylenium

                    • 7. Re: generate sinewave with keyframed wavelength
                      clayevans Level 1

                      hey!

                       

                      ok i have tried it to move the emitter an set the veloc of the particleemitter to zero. without wavelength changes everything works fine, the vom frame 0-60 i changed the wavelength value from 20 to zero and AE dont get even this.


                      maybe i dont get the point but, hm.

                      i attached my testingscene maybe this is better. ist CS3 an particular 2. it should also work with 1.5

                       

                      related to write-on, i havent work with this effect yet. but i know i need particular because i have a project and this "sinewave thing is just the preparation" for. later i have to create flow streaks which can "fly" helixes, circles, spheres... and this all beginns with an flat line..so i think particular gives me a good start because it got the full 3D feature and powerful creative options.

                       

                      greets clay

                      (grüsse aus düsseldorf  )

                      • 8. Re: generate sinewave with keyframed wavelength
                        Mylenium Most Valuable Participant

                        Well, you are not moving in Y. Obviously that is not going to expand the motion. you can also simply use Wind Y. Since contrary to the normal velocity parameter, wind is a continuous linear force, this should work as well. as for the rest - you are complicating things unnecissarily. trapcode Form is pretty much the answer to most of your problems. See this example on my website. Also consider CC Ball Action and Trapcode 3D Stroke, they have simple Twist parameters, too.

                         

                        Mylenium