Welcome to Doom9's Forum, THE in-place to be for everyone interested in DVD conversion.

Before you start posting please read the forum rules. By posting to this forum you agree to abide by the rules.

 

Go Back   Doom9's Forum > Capturing and Editing Video > Avisynth Usage

Reply
 
Thread Tools Search this Thread Display Modes
Old 21st January 2018, 21:39   #1  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Value of a variable depending on frame number

Hello everybody,

So I have a variable X in my script. It controls the amount of FredAverage() overlayed on my GamMac() detect clip.

I want his variable to be 34 for the entire clip, except for certain frames/scenes.

For example this variable must be 34 for frames 0-2000.
Then 64 for frames 2000-2400.
Then again 34... and so on.

What do I need for this?
Conditional reader with an external frame numbers list or something similar?

thanks in advance,
Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 21st January 2018, 23:12   #2  |  Link
ChaosKing
Registered User
 
Join Date: Dec 2005
Location: Germany
Posts: 1,795
I would try RemapFrames http://avisynth.nl/index.php?title=R...es&redirect=no or ApplyRange (scroll down)
__________________
AVSRepoGUI // VSRepoGUI - Package Manager for AviSynth // VapourSynth
VapourSynth Portable FATPACK || VapourSynth Database
ChaosKing is offline   Reply With Quote
Old 21st January 2018, 23:46   #3  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Required RT_Stats v2.0 Beta(latest). [For RT_DBaseReadCSV() & RT_DBaseFindSeq()]
Here:- https://forum.doom9.org/showthread.p...26#post1818026

Steps:-
Create CSV txt file.
Make DBase via Make_DBase.avs
Use FredDB.Avs

Make_DBase.avs
Code:
# Make_DBase.avs
#########################
CSV="Fred_CSV.Txt"      # CSV.txt file containing text something like this
### Three Fields in DBase: Field 0=StartFrame, 1=EndFrame, 2=Value
# 100,200,50   # EDIT: Without the comments, of course
# 400,500,60
# 700,750,70
# 900,999,80
###
DB            = "Fred_CSV.DB"
TypeString    = "iii"              # 3 DB Fields, all type Int, Same as in CSV file above. (b=BOOL,i=INT,f=FLOAT,s=STRING,n=BIN(8bit Int).
###
CSV=RT_GetFullPathName(CSV)
DB=RT_GetFullPathName(DB)
RT_DBaseAlloc(DB,0,TypeString)     # Allocate DBase with 0 pre-allocated records, three Int Fields.
###
Added=RT_DBaseReadCSV(DB,CSV)
#RT_DBaseQuickSort(DB,Field2=1)   # Un-Comment if Ranges NOT in sorted order.
Return MessageClip("Added "+String(Added)+" Records")   # Shows "Added 4 Records where same as above Fred_CSV.Txt Example".
FredDB.Avs
Code:
# FredDB.Avs : Required RT_Stats v2.0 Beta(latest). [For RT_DBaseReadCSV() & RT_DBaseFindSeq()]
GScript("""
    Function FredFun(clip c,String DB,Int Default_Val,Int ValMax,Bool Show) {
        myName="FredFun: "
        c
        n           = current_frame
        Records     = RT_DBaseRecords(DB)   # Number of records in the DBase
        Start_Field = 0                     # Field in DBase that holds Start Frame Int (as per CSV file).
        End_Field   = 1                     # Field in DBase that holds End Frame Int.
        Val_Field   = 2                     # Field in DBase that holds Fred Value (in this case is an Int as specified in DB TypeString).
        Find_Frame  = n                     # Frame Number to search for in DBase.
        Low         = 0                     # Default 0. Lowest record number to scan (likely almost always 0).
        High        = Records-1             # Highest record number to scan (likely almost always as default RT_DBaseRecords(DB)-1).

        FndRec=RT_DBaseFindSeq(DB,Start_Field,End_Field,Find_Frame,Low=Low,High=High)  # Search DBase for sequence holding current_frame n
        if(FndRec>=0) {
            UseVal = RT_DBaseGetField(DB, FndRec, Val_Field)    # Get the value set for this frame (third val in CSV file)
        } Else {                                                # Fndrec -1, Record containing current frame Not Found
            UseVal = Default_Val                                # Use the Default, ie range not set in CSV.
        }

        Assert(0 <= UseVal <= ValMax, RT_String("FredFun: 0 <= ValMax <= %d (%d)",ValMax,UseVal))  # UseVal Range 0 -> ValMax ONLY

        #
        # Do whatever you want here to add FredAverage based on UseVal
        #

        if(Show) {
            if(FndRec>=0) {
                SIZE  = Last.Height/10
                COLOR = $FF00FF
                Start = RT_DBaseGetField(DB, FndRec, Start_Field)       # Where this range starts
                End   = RT_DBaseGetField(DB, FndRec, End_Field)         # Where this range ends
                S=RT_String("%d:%d:%d,%d] Val = %d",n,FndRec,Start,End,UseVal)
            } Else {
                SIZE  = Last.Height/14
                COLOR = $FFFF00
                S=RT_String("%d] Val = %d",n,UseVal)
            }
            Subtitle(S,Align=5,y=Height/2,Size=SIZE,Text_Color=COLOR)
        }
        Return Last
    }
""")

#### CONFIG ####
FN          = "Parade.Avi"
DB          = "Fred_CSV.DB"
Default_Val = 34
SHOW        = True
VALMAX      = 100    # Default_Val and CSV entries must be 0 -> VALMAX range.
################
FN          = RT_GetFullPathName(FN)
DB          = RT_GetFullPathName(DB)
ARGS        = "DB,Default_Val,ValMax,Show"          # FredFun args, excluding clip c
AviSource(FN)
Last.GScriptClip("FredFun(last, "+ARGS+")", local=True, args=ARGS)
Return Last
I've made it a sort of lesson rather than do it for you, if you have probs, just say.

ClipClop could also be used if many similar values for the non default range, just like ChaosKing suggestion.

EDIT: Entries in CSV HAVE TO BE SEQUENTIAL, else could fail to find them.
EDIT: Added In BLUE.

EDIT: Further on CSV.
Code:
RT_DBaseReadCSV(String DB, String CSV, String "Separator"=",",String "StrDelimiter"="\"",Int "StartField"=0,Int "EndField"=last_field)

    This function will extract CSV values in text file, and append them as records to an appropriately formatted DBase file.

    DB,           FileName of an RT_Stats DBase file.
    CSV,          FileName of a text CSV (Comma Separated Value) file.
    Separator     Default "," ie comma separator (first character only, Chr()'s 0, 13, 10, and 34 [Double Quote] illegal).
                  Default Separator "," (Comma) is optional and so long as CSV values are SPACE/TAB separated will not produce an error
                  if separator is missing.
    StrDelimiter  Default = "\"" ie single character string Double Quote.
                  StrDelimiter (String Delimiter) can be multiple characters (empty string "" illegal, also cannot contain the Separator
                  character nor SPACE or TAB), Default is a Double Quote single character string.
                  CSV string values CANNOT contain StrDelimiter string, ie for default StrDelimiter, strings cannot contain a double
                  quote character string. So long as the StrDelimiter does not appear within any string, nearly any StrDelimiter can be
                  used, eg "@@@" is a 3 character StrDelimiter that you could use in place of double quote string delimiters, where the
                  string values could then contain a double quote character, in such a case you should enclosed CSV strings as in
                  @@@Some text that contains a " double quote.@@@.
                  NOTE, StrDelimiter IS case sensitive, so if using alphabetic characters they have to match exactly.

    StartField    Default = 0.
    EndField      Default = last field in DBase record (By default, all fields should be present in CSV file, else error).
                  Above StartField and EndField args allow setting of limited number of CONSECUTIVE fields within a record, the remaining
                  fields if any are set to NULL values, ie String all zero chars, bool = false, Float=0.0, int and bin=0.

    Function returns Int, the number of records added to the DBase.
    (Maximum line length in CSV text file is 64*1024 characters).

    Example:-
        CSV.txt file containing text something like this
        ###
            1  ,42.0 ,true , "Hello"        # I am a comment
            2  ,43.5 ,false, "Goodbye"
            $FF,3.142,TRUE , "Coconuts"     # So Am I
        ###
        Script:-
        DB  = "My.DB"
        CSV = "CSV.txt"
        RT_DBaseAlloc(DB,0,"ifbs32")        # Allocate DBase with 0 pre-allocated records, 4 fields, 0)=Int, 1)=Float, 2)=bool, 3=String(maxlen=32).
        Added=RT_DBaseReadCSV(DB,CSV)
        Return MessageClip("Added "+String(Added)+" Records")   # Shows "Added 3 Records".
RT_DBaseFindSeq
Code:
RT_DBaseFindSeq(String DB,Int S_Field,Int E_Field,Int Frame,Int "Low"=0,Int "High"=RT_DBaseRecords(DB)-1)

 RT_DBaseFindSeq Returns clip (or record) number containing movie frame Frame, using Binary Search.

   DB,      DBase FileName,
   S_Field, DB field that contains the first frame of the record clip/sequence (within entire movie).
   E_Field, DB field that contains the Last frame of the record clip/sequence (within entire movie).
   Low,     Default 0. Lowest record number to scan (likely almost always 0).
   High,    Default RT_DBaseRecords(DB)-1. Hightest record number to scan (likely almost always as default).

   Return of -1 = RECORD NOT FOUND.

   eg If you have 4 clips in DBase, each of 10 frames then fields should contain data EXACTLY as below (must be ordered).
      Record     S_Field   E_Field
         0           0        9
         1          10       19
         2          20       29
         3          30       39
EDIT: ClipClop, or RemaplFramesSimple would be faster (than Scriptclip), but not as much fun EDIT: RT_DBaseFindSeq() is real fast.
Above stuff could easily be extended for other uses and/or additional variables (DBase supports up to 1024 Fields).

EDIT:
Quote:
ClipClop could also be used if many similar values for the non default range.
ClipClop(), is also used by FrameSurgeon() / SawBones combo.
Say you had 7 non default values,
create 7 clips, where, FX1-Fx7 use non default values in creating each clip [EDIT: FredAverage GamMac clips].
Using ClipClop via FrameSurgeon (supplying to FrameSurgeon, src=DefaultValueClip, + FX1->FX7),
create a 3x3 stack of 9 clips, src=DefaultValueClip, + FX1->FX7, + FrameSurgeon result frames.
Use Sawbones to view 3x3 stack and select and mark required FXn ranges, create FrameSurgeon frames file.
Run FrameSurgon for real with FINAL=True (source [in this case DefaultValueClip] is the default if not frame assigned as FXn).
Sorted.

DO NOT USE INTERPOLATED or other non Fx edits in SawBones, it would interpolate from DefaultValueClip. (Unless that is what you want).
If you only had 6 non defaults, then could also SHOW ONLY the real source frames in 3x3 stack.
If you have a real big monitor, could use DefaultValueClip + FX1 -> FX9 + real source + result in 3x4 or 4x3 stack.

EDIT: You feed the 3x3 stack into Sawbones (well, VirtualDubFilterMod when using SawBones), so you can select from avalable FX clips,
and view result when Save & Refresh key pressed.

EDIT: This one(SawBones):- https://forum.doom9.org/showthread.p...40#post1829340
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd January 2018 at 06:06.
StainlessS is offline   Reply With Quote
Old 22nd January 2018, 12:55   #4  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
I've made it a sort of lesson rather than do it for you, if you have probs, just say.
Thank you!

First question: where do I begin?

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 22nd January 2018, 13:09   #5  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Quote:
Originally Posted by videoFred View Post
First question: where do I begin?

Fred.
Got it!

First: create text file
Then: Makes_Dbase.avs
Then: Fred_Fred_DB.avs

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 22nd January 2018, 13:10   #6  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Which one, DBase or FrameSurgeon Sawbones ?
Do you have existing ranges file ?

EDIT YEP, thats it.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???
StainlessS is offline   Reply With Quote
Old 22nd January 2018, 13:13   #7  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Try with the provided demo first, get the hang of what you are doing.

EDIT: Small update to FredDB.Avs.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 22nd January 2018 at 13:49.
StainlessS is offline   Reply With Quote
Old 22nd January 2018, 15:17   #8  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
FredDB.Avs,

Added FredAve block to base of input clip, total 256 pixels tall, UseVal governs how much of it is inverse of FredAveage (Default_Val & UseVal must be 0 <= val <= 256).

EDIT: If you would prefer UseVal 0 -> 100, could easily change or make variable to your choice.

EDIT: Changed/Added default ValMax=100, Change to 256 if you prefer.
EDIT: Bit more fiddling, added Rangenum, Start/End frames to Subtitle.

EDIT: Restoreed my 1st post to almost original post.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 23rd January 2018 at 06:07.
StainlessS is offline   Reply With Quote
Old 22nd January 2018, 15:36   #9  |  Link
videoFred
Registered User
 
videoFred's Avatar
 
Join Date: Dec 2004
Location: Terneuzen, Zeeland, the Netherlands, Europe, Earth, Milky Way,Universe
Posts: 689
Thanks!

No time to work on it now...
Will come back a few days later

Fred.
__________________
About 8mm film:
http://www.super-8.be
Film Transfer Tutorial and example clips:
https://www.youtube.com/watch?v=W4QBsWXKuV8
More Example clips:
http://www.vimeo.com/user678523/videos/sort:newest
videoFred is offline   Reply With Quote
Old 23rd January 2018, 05:47   #10  |  Link
StainlessS
HeartlessS Usurer
 
StainlessS's Avatar
 
Join Date: Dec 2009
Location: Over the rainbow
Posts: 10,980
Quote:
Will come back a few days later
Very diplomatic of you.
The previous attempt was pretty awful, guess you need time to think up some response
I'll return original script back to nearer original post, we dont want anyone using that, but could be good lesson to keep without the recent screwed up attempt.

Here, some mods, hope it performs better for you.
Suggest that you try demo before anything else (always a good suggestion when I supply demo).

Fred_CSV.Txt, copy to file.
Code:
# test CSV File, StartFrame, EndFrame, Value(Int converted to FLOAT, VarMax=100.0)
   0,  0,    0     # Values (3rd field) int's will be converted to Float.
   1,  1,   10
   2,  2,   20
   3,  3,   30
   4,  4,   40
   5,  5,   50
   6,  6,   60
   7,  7,   70
   8,  8,   80
   9,  9,   90
  10, 10,  100
  11,  99,   0
 200, 299,  10
 400, 499,  20
 600, 699,  30
 800, 899,  40
1000,1099,  50
1200,1299,  60
1400,1499,  70
1600,1699,  80
1800,1899,  90
2000,2099, 100
2200,9999, 100
Make_DBase.avs (NOTE, third field now FLOAT (will accept int and convert).
Code:
# Make_DBase.avs
#########################
CSV="Fred_CSV.Txt"      # CSV.txt file containing text something like this
### Three Fields in DBase: Field 0=StartFrame, 1=EndFrame, 2=Value (NOW FLOAT)
# 100,200, 50
# 400,500, 60
# 700,750, 70
# 900,999, 80
###
DB            = "Fred_CSV.DB"
TypeString    = "iif"              # 3 DB Fields, 2 type Int, 1 type FLOAT. (Can supply Value field as int, will be converted to Float.
                                   # b=BOOL,i=INT,f=FLOAT,s=STRING,n=BIN(8bit Int).
###
CSV=RT_GetFullPathName(CSV)
DB=RT_GetFullPathName(DB)
RT_DBaseAlloc(DB,0,TypeString)     # Allocate DBase with 0 pre-allocated records, three Fields.
###
Added=RT_DBaseReadCSV(DB,CSV)
RT_DBaseQuickSort(DB,Field2=1)     # Ensure Ranges in sorted order (Ranges should NOT overlap).
Return MessageClip("Added "+String(Added)+" Records")   # Shows "Added 4 Records where same as above Fred_CSV.Txt Example".
FredDB.Avs
Code:
# FredDB.Avs : Required GamMac, GScript, Grunt, RT_Stats v2.0 Beta(latest).
GScript("""
    Function FredFun(clip c,String DB,Float Default_Val,Float ValMax,Int DampHeight,Bool Show) {
        myName="FredFun: "
        c
        n           = current_frame
        Records     = RT_DBaseRecords(DB)   # Number of records in the DBase
        Start_Field = 0                     # Field in DBase that holds Start Frame Int (as per CSV file).
        End_Field   = 1                     # Field in DBase that holds End Frame Int.
        Val_Field   = 2                     # Field in DBase that holds Fred Value (in this case is a Float as specified in DB TypeString).
        Find_Frame  = n                     # Frame Number to search for in DBase.
        Low         = 0                     # Default 0. Lowest record number to scan (likely almost always 0).
        High        = Records-1             # Highest record number to scan (likely almost always as default RT_DBaseRecords(DB)-1).
        FndRec=RT_DBaseFindSeq(DB,Start_Field,End_Field,Find_Frame,Low=Low,High=High)  # Search DBase for sequence holding current_frame n
        if(FndRec>=0) {
            UseVal = RT_DBaseGetField(DB, FndRec, Val_Field)    # Get the value set for this frame (third val in CSV file)
        } Else {                                                # Fndrec -1, Record containing current frame Not Found
            UseVal = Default_Val                                # Use the Default, ie range not set in CSV.
        }
        Assert(0.0 <= UseVal <= ValMax, RT_String("FredFun: 0 <= ValMax <= %.2f (%.2f)",ValMax,UseVal))  # UseVal Range 0 -> ValMax ONLY

        PIC_HEIGHT = Height - DampHeight - (SHOW?48:0)
        Cropped = Last.Crop(0,0,0,PIC_HEIGHT)                                 # Remove Temp Padding
        RealAve = Cropped.FredAverage.BilinearResize(Width,DampHeight)       # This is actual Average
        FredAve = RealAve.Invert                                              # This is negative of Average (Fred's Average)
        op      = (Float(UseVal) / ValMax)
        Damper  = OverLay(RealAve,FredAve,Opacity=op)
        StackVertical(Cropped,Damper)                                         # Dampen GamMac

        if(Show) {
            if(FndRec>=0) {
                SIZE  = Cropped.Height/14
                COLOR = $FF00FF
                Start = RT_DBaseGetField(DB, FndRec, Start_Field)       # Where this range starts
                End   = RT_DBaseGetField(DB, FndRec, End_Field)         # Where this range ends
                S = RT_String("%d:%d:%d,%d] Val = %.2f",n,FndRec,Start,End,UseVal)
            } Else {
                SIZE  = Cropped.Height/18
                COLOR = $FFFF00
                S = RT_String("%d] Val = %.2f",n,UseVal)
            }
            Subtitle(S,Align=5,y=(Cropped.Height+SIZE)/2,Size=SIZE,Text_Color=COLOR)
            K=Last.BlankClip(Height=4)
            RA=RealAve.BilinearResize(Width,20)
            FA=RA.Invert
            FA=FA.Subtitle(RT_String("FredAve : Opacity=%.2f (%.1f / %.1f)",Op,UseVal,ValMax))
            RA=RA.Subtitle("RealAve")
            AveBlock=StackVertical(K,FA,K,RA)                           # Metrics Block
            StackVertical(Last,AveBlock)
        }
        Return Last
    }
""")

# Stack Overhead Subtitle Text, with optional FrameNumber shown.
Function TSub(clip c,string Tit,Bool "ShowFrameNo"){
    c.BlankClip(height=20)
    (Default(ShowFrameNo,False))?ScriptClip("""Subtitle(String(current_frame,"%.f] """+Tit+""""))"""):Subtitle(Tit)
    Return StackVertical(c).AudioDubEx(c)
}

#################################
####         CONFIG          ####
#################################
FN          = "Parade.Avi"
DB          = "Fred_CSV.DB"
DampHeight  = 20                # Height of Dampen Bar, also adjusts Maximum Possible GamMac Dampening Effect, bigger, more dampening possible,
ValMax      = 100.0             # Float, Default_Val and CSV entries must be 0.0 -> VALMAX range. (Damper Maximum)
Default_Val = 75.0              # Float, GamMac Dampener Default Value, higher more dampening, ValMAx = Fully Damped.
SHOW        = true              # FredFun Show Metrics
GSHOW       = true              # GamMac Metrics
FINAL       = False             # True, No Metrics, Single Frame Final Result.
##### GamMac args
LockChan    = 1
SCale       = 2
RedMul      = 1.0
GrnMul      = 1.0
BluMul      = 1.0
Th          = 0.0
LockVal     = 128.0
OMin        = 0
OMax        = 255
Verbosity   = 2
################################
####       END CONFIG       ####
################################
SHOW =(FINAL)?FALSE:SHOW
GSHOW=(FINAL)?FALSE:GSHOW
FN          = RT_GetFullPathName(FN)
DB          = RT_GetFullPathName(DB)
ARGS        = "DB,Default_Val,ValMax,DampHeight,Show"               # FredFun args, excluding clip c
ABlk_H      = SHOW?48:0
CROPOFF     = DampHeight + ABlk_H
###
AviSource(FN).ConvertToRGB32                                        # Maybe Change source filter.
ORG=Last
#
AddBorders(0,0,0,CROPOFF,$0000)                                     # Add Padding to Bottom (ScriptClip can only return SAME SIZE as INPUT)
Last.GScriptClip("FredFun(last, "+ARGS+")", local=True, args=ARGS)  # FredFun, Add ColorBlock (Damper + AveBlock)
ColorBlock = Last.Crop(0,Last.Height-CROPOFF,0,0)                   # Save full ColorBlock for Later
AveBlock   = (SHOW) ? Last.Crop(0,Last.Height-ABlk_H,0,0) : NOP     # Save AveBlock
DampOrg    = Last.Crop(0,0,0,-ABlk_H)                               # Dont Let GamMac see AveBlock (No effect if SHOW=False)
G_NoDAMP   = ORG.GaMMac(Show=GSHOW,LockChan=LockChan,Scale=Scale,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
                \ Th=Th,LockVal=LockVal,OMin=OMin,OMax=OMax,Verbosity=Verbosity)
G_Damp     = DampOrg.GamMac(Show=GSHOW,LockChan=LockChan,Scale=Scale,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
                \ Th=Th,LockVal=LockVal,OMin=OMin,OMax=OMax,Verbosity=Verbosity)
G_DampNoMet= DampOrg.GamMac(Show=False,LockChan=LockChan,Scale=Scale,RedMul=RedMul,GrnMul=GrnMul,BluMul=BluMul,
                \ Th=Th,LockVal=LockVal,OMin=OMin,OMax=OMax,Verbosity=Verbosity)
WIN_1 = StackVertical(ORG,ColorBlock)
WIN_2 = G_NoDAMP.AddBorders(0,0,0,CROPOFF,$0000)
WIN_3 = (SHOW) ? StackVertical(G_Damp,AveBlock)  : G_Damp
WIN_4 = (SHOW) ? StackVertical(G_DampNoMet,AveBlock)  : G_DampNoMet
WIN_1 = (!FINAL) ? WIN_1.TSub("Original + DBar" + (SHOW?" + Dampen Metrics":"")) : WIN_1
WIN_2 = (!FINAL) ? WIN_2.TSub("GamMac No Dampen") : WIN_2
WIN_3 = (!FINAL) ? WIN_3.TSub("GamMac Dampen, GamMac mods DBar") : WIN_3
WIN_4 = (!FINAL) ? WIN_4.TSub("GamMac Dampen, GamMac mods DBar, No Metrics") : WIN_4
WIN_TOP=StackHorizontal(WIN_1,WIN_2)
WIN_BOT=StackHorizontal(WIN_3,Win_4)
StackWin = StackVertical(WIN_TOP,WIN_BOT)
Last = !FINAL ? StackWin : WIN_4.Crop(0,0,0,-DampHeight)
Return Last
Higher values Dampen GamMac effect, (could change it to other way around dampening the FredAverage Effect if required).

I'm a bit knackered, 04:46 and so will not say too much more, except hope that it makes up for my previous dismal performance.


EDIT
Below, original frame, with DBar (Dampening bar) + dampening metric.
Top bar (at the bottom) is DBar, and result after Overlay of FredAverage onto real Average, using DB thing Value (scaled 0.0->1.0)
for opacity. NOTE, in other windowed frames, the DBar will be changed by GamMac and so will look different color.
You can adjust the maximum possible (ie 100.0%) by varying the DampHeight (height of DBar), and so increase/decrease every value
setting effect at once.
Code:
DampHeight  = 20                # Height of Dampen Bar, also adjusts Maximum Possible GamMac Dampening Effect, bigger, more dampening possible,
ValMax used for scaling 0.0->1.0 for Opacity, you could make it 1000.0, or 255.0 or whatever, just need give suitable values
in CSV and Default_Value too.
Code:
ValMax      = 100.0             # Float, Default_Val and CSV entries must be 0.0 -> VALMAX range. (Damper Maximum)


EDIT: Above, GamMac effect fully Dampened, with limiting by DBar height.
EDIT: Maybe DBar height DampHeight should be set to eg 10.0% of frame height, or similar.
__________________
I sometimes post sober.
StainlessS@MediaFire ::: AND/OR ::: StainlessS@SendSpace

"Some infinities are bigger than other infinities", but how many of them are infinitely bigger ???

Last edited by StainlessS; 3rd June 2018 at 18:45.
StainlessS is offline   Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:29.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.