Log in

View Full Version : ApplyRange alternative


Zarxrax
27th October 2010, 16:28
Recently, Phantasmagoriat at the a-m-v.org forums wrote a very simple function, called Range() (http://www.animemusicvideos.org/forum/viewtopic.php?f=45&t=101949).

It basically works just like ApplyRange, but the syntax is much less confusing, and according to some, it is more efficient.

Now, I have always hated the syntax to ApplyRange, because I have found it extremely confusing, to the point that I have to consult the documentation every time I want to use it. Most other people I have spoken to agree on this matter. The Range() function, in comparison, allows you to write the arguments just as you normally would, as if they were outside the function.

Now, I don't like the idea of someone having to write a function to make a core avisynth feature more user friendly. I think that what is built into avisynth should be simple and accessible to most users.

That's why I decided to talk to IanB about adding a core function like this into AviSynth. I think this is really the type of thing that does belong in AviSynth, rather than being an external script. He has suggested that I post a thread to get feedback from others on this matter. So, I am curious what you think. Should AviSynth have this added as an alternative to the ApplyRange function?

dansrfe
27th October 2010, 17:46
I'm still in search of a function that applies a function to a certain number of frames at a certain interval.

Gavino
27th October 2010, 18:38
Recently, Phantasmagoriat at the a-m-v.org forums wrote a very simple function, called Range() (http://www.animemusicvideos.org/forum/viewtopic.php?f=45&t=101949).

It basically works just like ApplyRange, but the syntax is much less confusing, and according to some, it is more efficient.
As far as I can see, this is basically the same as stickboy's JDL_ApplyRange function. However, Range() has the classic bug often seen in these type of functions since it fails to allow for the special cases of frames at the start and end of the clip (the problem originally described here).
Nor is it any more efficient than the built-in ApplyRange.
Now, I have always hated the syntax to ApplyRange, because I have found it extremely confusing, to the point that I have to consult the documentation every time I want to use it. Most other people I have spoken to agree on this matter. The Range() function, in comparison, allows you to write the arguments just as you normally would, as if they were outside the function.
I don't see what's confusing about the syntax. If you want to use named parameters, you can always write a wrapper function for the filter and call ApplyRange on that instead.

The built-in ApplyRange also has a number of further alternatives within stickboy's functions, depending on what you want to do. Check out his jdl-range.avsi.
I'm still in search of a function that applies a function to a certain number of frames at a certain interval.
See stickboy's ApplyEvery plugin.

All stickboy's stuff can be found on this page (http://avisynth.org/stickboy/).