Hi. I often use this command at the beginning of a scene edit:
Is it possible to make a 'function' of the loop part so that I can simplify my scripts something like this:Code:loop(250,9999,9999).trim(9999,9999+249).amplify(0).fadein0(25)
meaning, repeat frame 999 250 times with a 25 frame fadein. If possible, 'Amplify(0)' would be incorporated into the function.Code:rpt(999,250,25)
Grateful thanks for any thoughts you may have.
		
			+ Reply to Thread
			
		
		
		
			
	
	
				Results 1 to 8 of 8
			
		- 
	Last edited by pooksahib; 8th Feb 2020 at 08:36. Reason: grammar 
- 
	Thanks, abolibibelot. I've been trying to get my head around functions by reading this page: 
 http://avisynth.nl/index.php/User_defined_script_functions
 but it's proving to be beyond someone like myself who came to computers later in life. I'll hang around here for a while as I've had enormous help from members of this forum in the past.
- 
	assuming I didn't overlook something: 
 should do the trick.Code:function rpt(clip input, int frame, int times, int fadeIn) { clip = clip.loop(times,frame,frame).trim(frame,frame+times-1).amplify(0).fadein0(fadeIn) return clip }
 
 Cu Selurusers currently on my ignore list: deadrats, Stears555, marcorocchini
- 
	Hallo, Selur und Vielen Dank for that. Very kind of you to take the time. I've tried using on an existing script but I get an error message saying the video stream cannot be opened. Am I 'calling' the function correctly?Code:rpt(999,250,25) 
- 
	fixed: 
 Code:function rpt(clip input, int frame, int times, int fadeIn) { input.loop(times,frame,frame).trim(frame,frame+times-1).amplify(0).fadein0(fadeIn) }
- 
	Superb, jagabo, thank you so much. It looks simple but I just can't 'read' that programming. I did, however, write a function to do a loop with a fadeOUT. That was easy... 
 
 Thanks again, and to you, too, Selur.
- 
	doh overlooked that I renamed the clip to input so 
 also should work.Code:function rpt(clip input, int frame, int times, int fadeIn) { input = input.loop(times,frame,frame).trim(frame,frame+times-1).amplify(0).fadein0(fadeIn) return input }users currently on my ignore list: deadrats, Stears555, marcorocchini
Similar Threads
- 
  Disable shortcut keys for ffplayBy Belini in forum Video ConversionReplies: 4Last Post: 9th Nov 2019, 10:13
- 
  PAL-speedup command in Avisynth ?By Gwar in forum Video ConversionReplies: 6Last Post: 19th Mar 2019, 02:11
- 
  Avisynth command to change aspect ratioBy pooksahib in forum Video ConversionReplies: 4Last Post: 19th Oct 2017, 09:03
- 
  Making a vid from two different sources using avisynthBy pooksahib in forum Video ConversionReplies: 7Last Post: 19th Jun 2017, 00:26
- 
  vegas import shortcutBy ricmetal in forum EditingReplies: 6Last Post: 13th Feb 2016, 13:24


 
		
		 View Profile
				View Profile
			 View Forum Posts
				View Forum Posts
			 Private Message
				Private Message
			 
 
			
			

 Quote
 Quote Visit Homepage
				Visit Homepage