Archive: Duration of effects?


6th May 2002 05:47 UTC

Duration of effects?
Hi everyone... I just starting making presets today, and I have a question. Is it possible to make an effect only last for a certion amount of time? Like let's say everything is going along and just for a little while I want the interleave to come in, and then everthing goes back to normal for a while. Can I do that? :weird:


6th May 2002 06:18 UTC

Here's a possible setup:

+ Effectlist: Input-Replace, Output-Ignore
- Interleave
- Buffer Save -> Save to Buffer 1
(outside effect list):
Dynamic movement: gridsize 1x1, check 'no movement (blend only)', specify Buffer 1 as source, and then write code that gives the variable 'alpha' a value between 0 and 1.

What happens is that AVS will make a copy of the current image before the preset, move into the effect list, apply the Interleave, and store the result in Buffer 1. Then, the dynamic movement (which we'll only be using as a dynamic blend) will blend between the normal image and the one in buffer 1. Alpha will specify how much buffer 1 is blended onto the original.

You'll need to learn how to write AVS code though. If you've done any kind of programming, it should be easy, and even without that, it shouldn't be too hard. Good knowledge of maths is a plus, because that's the basis for all the effects.

Here's an example piece of code for the blend (just paste these pieces of code in the appropriate box):

Init:

bv=0; bt=0;

Frame:
bv=bv * 0.9 + bt * 0.1;

OnBeat:
bt=1 - bt;

Point:
alpha=bv


This'll probably look weird at first. First, we set the custom variables (i.e. AVS doesn't assign any meaning to them) bv and bt, blend-value and blend-target, both to zero.
For every point, we use bv's value and use it as alpha-value.
Every beat, bt is given the value (1 - bt) instead. So if bt starts out zero, that means it'll alternate between one and zero every beat.
Now, every frame, we apply the formula above. This means that we assign 'bv' 90% of the original value, and 10% of the bt value. That's just a nice way of doing a transition from one value to a target value. So, every beat, the target value bt changes, and bv will change slowly to adjust, giving you a nice blend from non-interleaved to interleaved.

6th May 2002 07:00 UTC

:eek:

you just flew over my head, maybe if i go through it one step at a time i'll get there. :confused:


6th May 2002 07:51 UTC

You can alternate between two affects like I did here...it comes with an explanation of where to put the effects and how it works.


8th May 2002 09:57 UTC

On beat active effectlists together with custom BPM does effects on beat for a certain amount of frames:

...main
...-some permanent stuff
...+effectlist
.....-custom bpm ( i.e. skip 3 frames )
.....+effectlist active x frames
.......-your effects
...+effectlist
.....-custom bpm (i.e skip 7 frames)
.....+effectlist active y frames
.......-your effects

experiment with this also together with unconeds setup so you should get the desired results.


8th May 2002 10:54 UTC

Well I know this will all look very complicated, but you'll get the hang of it sooner or later. Here's a better explanation of some of the components:

- Effect List: this is essentially a preset-inside-a-preset. You can set it to receive the input image from outside the effect list, and it can output its result as well.

- Dynamic Movement: this is a cool effect that allows you to move the image around according to an ever-changing formula. Now because evaluating an expression for every single pixel on the screen is waaay to slow, AVS uses only a grid of points. Then, it uses interpolation to find the position of the points in between the grid.
However, a dynamic movement also allows you to specify the transparency of every grid point, and if you check the "no movement" box, you specifically specify that you only want to use it as a "dynamic blender", without any movement. I use a 1x1 grid size (i.E. no grid) to use it to blend between the non-interleaved and interleaved version.