Log in

View Full Version : I wish you a merry christmas (2023 script)


hanfrunz
23rd December 2023, 13:03
Hello everyone, here is the christmas script for 2023. Peace! Happy Festivus and please stay healthy!


function c(clip left, int color){return StackHorizontal(left,BlankClip(1,2,2,"YV16",25,1,color_yuv=color))}
function s(clip v){return v.BilinearResize(720,576).Histogram("color").crop(720,0,0,256).Tweak(sat=0).converttoyuy2().bicubicresize(512,512)}
function p(float len, float freq){return audiodub(BlankClip(length=int(len*24), width=576,height=576, pixel_type="rgb32",fps=25, color=int((freq-271.0)/1.72)),tone(len,freq,channels=1,level=1.0).FadeIO0(1,0,24))}
function q(float len, float freq){return tone(len,freq,channels=1,level=0.5).FadeIO0(1,0,24)}
c=261.6255653006 D=293.6647679174 E=329.6275569129 F=349.2282314330 Gb=369.9944227116 G=391.9954359817 A=440.00000000001 B=493.8833012561 c2=c*2.0 d2=d*2.0 e2=e*2.0 f2=f*2.0 N4=0.5 N8=0.25 s1=BlankClip(1,2,2,"YV16",25,1,color_yuv=$589e57).c($009e57).c($00800c).c($596356).c($00115d).c($54115d).c($544f90).c($003bdf).c($2280b4).c($0080b4).c($00c5e0).c($38b191).c($00f05d).c($58f05d).c($589e57).loop(576-12) s=Animate(s1,0,554,"Tweak", 0.0, 0.0, 0.0, 0.0, true, false, 0.0, 360.0, 150.0, 0.0, 16.0, false, -576.0, 1.0, 0.0, 0.0, true, false, 0.0, 360.0, 150.0, 0.0, 16.0, false) t=Animate(s1,0,554,"Tweak", 0.0, 6.0, 0.0, 0.0, true, false, 0.0, 360.0, 150.0, 0.0, 16.0, false, -576.0, 4.0, 0.0, 0.0, true, false, 0.0, 360.0, 150.0, 0.0, 16.0, false)
overlay(s(t),s(s),x=0,y=0,opacity=0.5,mode="blend")
ani=Blankclip(last).trim(0,10) + last.fadein(6)
BlankClip(length=576, width=400,height=400, pixel_type="rgb32",fps=24, color=0).subtitle(" . * . * ",y=50,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*1,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*2,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*3,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*4,size=46,align=5, font="Courier New").subtitle(" * . * ",y=50+30*5,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*6,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*7,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*8,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*9,size=46,align=5, font="Courier New").greyscale().GeneralConvolution(0, "5 10 10 10 5 10 10 5 10 10 5 10 10 10 5 10 10 10 10 10 5 10 10 10 5 ", 200, false).crop(0,10,0,-076)
stackvertical(last,last,last,last)
sn=stackhorizontal(last,last,last)
sn=Animate(0,576,"Bicubicresize",sn, 576,576, 1./3.,1./3., 576./3., 1256.-576.,576,576, sn, 576,576, 1./3.,1./3., 0., 0.,576,576)
mix=mixaudio(p(N4,G)+p(N4,c2)+p(N8,c2)+p(N8,d2)+p(N8,c2)+p(N8,B)+p(N4,a)+p(N4,a)+p(N4,a)+p(N4,d2)+p(N8,d2)+p(N8,e2)+p(N8,d2)+p(N8,c2)+p(N4,b)+p(N4,g)+p(N4,g)+p(N4,e2)+p(N8,e2)+p(N8,f2)+p(N8,e2)+p(N8,d2)+p(N4,c2)+p(N4,a)+p(N8,g)+p(N8,g)+p(N4,a)+p(N4,d2)+p(N4,b)+p(1,c2)+p(N4,g)+p(N4,c2)+p(N4,c2)+p(N4,c2)+p(1,b)+p(N4,b)+p(N4,c2)+p(N4,b)+p(N4,a)+p(1,g)+p(N4,d2)+p(N4,e2)+p(N8,d2)+p(N8,d2)+p(N8,c2)+p(N8,c2)+p(N4,2*g)+p(N4,g)+p(N8,g)+p(N8,g)+p(N4,a)+p(N4,d)+p(N4,b)+p(1,c2),q(N4,G)+q(1,e)+q(N4,c)+q(1,F)+q(N4,G)+q(N4,F)+q(N4,d)+q(N4,Gb)+q(N4,g)+q(N4,d)+q(N4,f)+q(N4,g)+q(N4,d)+q(N4,f)+q(N4,a)+q(N4,f)+q(N4,g)+q(N4,f)+q(N4,Gb)+q(N4,f)+q(1,e)+q(N4,e)+q(N4,c2)+q(N4,b)+q(N4,a)+q(1,g)+q(N4,g)+q(N4,a)+q(N4,g)+q(N4,f)+q(N4,e)+q(N4,f)+q(N4,g)+q(N4,c2)+q(N4,g)+q(N4,a)+q(1,g)+q(N4,e)+q(N4,f)+q(N4,Gb)+q(N4,f)+q(1,e))
overlay(mix, sn,mode="blend", opacity=0.25)
overlay(ani, last,mode="add", opacity=0.75)
audiodub(last.killaudio(),mix)
Dissolve(last.trim(0,100), last.trim(101-12,576).subtitle("I wish all avisynth developers and users\n a merry christmas and a happy new year!\n\n(hanfrunz 2023)", align=5, lsp=10, text_color=$ffff00, halo_color=$ff0000),12).fadeout(25)
fadein(6).ConvertToYV12()
#

gispos
23rd December 2023, 16:49
Every year again :), I hope it will be like this for a very long time.
Thank you!

johnmeyer
23rd December 2023, 18:06
Every year I look forward to this. Thanks for continuing your tradition!

Boulder
23rd December 2023, 19:30
There's no Christmas without the annual festive script :) Thanks, and everyone have a Merry Christmas!

StainlessS
24th December 2023, 07:16
Cheers hanfrunz, and a merry XMas to all.

StainlessS
24th December 2023, 07:44
See StainlessS@MediaFire (below in my sig) in PUBLIC folder for "HanFrunz_XMas_Extravaganza_2023.7z" [20KB],

Or Direct link here:- https://www.mediafire.com/file/n3wx0lai3hobagz/HanFrunz_XMas_Extravaganza_2023.7z/file

Just under 5 minutes of Hanfrunz XMas goodness. (all episodes continuous play, from 2010 to 2023), requires AVS+ and RT_Stats in Plugins.

(My favourite is still 2015), thanx again HF. [I dont have 3D glasses for 2018 edition, but I'm sure its lovely if you do].

https://www.cosgan.de/images/smilie/xmas/z700.gif



https://www.cosgan.de/images/midi/xmas/f041.gif

Jamaika
24th December 2023, 09:16
Have the gifts reached everyone yet?
The masses of people at DHL did not disappoint.
Black Friday was successful 50% discount in the US.
I wish everyone peaceful Christmas.
I'm taking break from the computer and thinking about what to do in the new year to make things better. Is there better world somewhere?
https://praisebaltimore.com/wp-content/uploads/sites/26/2023/11/16998891111263.jpg?strip=all&quality=80&w=674&crop=0,0,100,518px

FranceBB
24th December 2023, 12:55
Thank you for keeping this tradition going hanfrunz and thank you StainlessS for putting them all together! :D
When it comes to me, all I can say is that it's been another great year for Avisynth at Sky, with the old 6 on prem servers with 56c/112th each now being actively helped by 100 elastic 8c/8th (c6i.2xlarge) + 5 elastic 16c/16th (c6i.4xlarge) cloud servers running on AWS in Ireland which are dynamically created to cope with the demand. Last year, we encoded 174,791 files while this year we're up 16% to 207,672 files, but the important thing is that 32,103 of those (15%) were processed entirely in the cloud, which is rather remarkable. Avisynth and x26x, BMX Transwrap, Libav etc are now handling the overwhelming majority of files going through our systems, slowly but surely reducing the impact of expensive proprietary closed source solutions in favor of free open source ones, which is a great success for the wider Open Source community here on Doom9 which I'm proud to be part of! We'll see what 2024 has for us but for now I wish you all a very Merry Christmas and a Happy New Year! :)

Statistics and Graph (High Res Version) (https://i.imgur.com/PYrfEcw.png)

https://i.imgur.com/MLXPLKt.png

pinterf
24th December 2023, 13:32
Thanks for the Xmas present script.
I wish you a Merry Christmas and a Happy (or at least a peaceful) New Year to you all.

Frank62
24th December 2023, 13:45
Merry Christmas to all you great helpful people, also from the much too warm, windy, and rainy Germany!

real.finder
24th December 2023, 15:23
Thank you and Thanks StainlessS for the 2010 to 2023 pack.

Merry Christmas and Happy New Year.

lollo2
24th December 2023, 17:49
When it comes to me, all I can say is that it's been another great year for Avisynth at Sky

Excellent Francesco!

Merry Christmas and Happy New Year to the community!

GMJCZP
24th December 2023, 20:00
I wish you a Merry Christmas for everyone!
Thanks hanfrunz for your script and TinMan for preserve in MediaFire this tradition. God bless you!

Reel.Deel
24th December 2023, 20:35
Happy holidays everyone!

StvG
25th December 2023, 08:38
Happy holidays!

lansing
25th December 2023, 21:49
Merry Christmas everyone!!

anton_foy
26th December 2023, 10:33
Too late but merry christmas anyway :)

lansing
25th December 2025, 17:10
Where is the Christmas script for this year?

johnmeyer
27th December 2025, 04:01
I don't think he's doing them anymore, but there is a treasure trove of past scripts you can play.

StainlessS
27th December 2025, 10:38
See here:- [ Hanfrunz_XMas_Extravaganza_Emulgator_PortalScope_2024.avs ] https://forum.doom9.org/showthread.php?p=2012080#post2012080

Contains all Hanfrunz scripts 2010 -> 2023 + Emulgator_PortalScope + small script to play all one after another, over 5 mins of xmas goodness.
(If you updated AVS+ recently, you need the update from yesterday (bugfix for animate floats)).

Avisynth r4403.

https://github.com/pinterf/AviSynthPlus/releases/tag/v3.7.6pre-r4403

Fixed Animate, which has a glitch preventing running Xmas scripts.

20251225 3.7.5.r4403 (pre 3.7.6)

Fix: The Animate() function now explicitly clamps interpolated values to ensure they remain
strictly between the start and end range. Due to the high precision of 64-bit double introduced
in v3.7.5, intermediate calculations could slightly exceed the boundary (e.g., 360.00000000000006
when interpolating from 0 to 360.0 in 564 steps), requiring this clamp to prevent out-of-range errors.

ClickMe [twice for original size]
https://i.postimg.cc/mPZ8bty0/Hanfrunz-XMas-Extravaganza-Emulgator-Portal-Scope-2024-00.jpg (https://postimg.cc/mPZ8bty0)

7z zip [24KB] contains all original scripts, + links to where posted on D9.

Emulgator
31st December 2025, 21:58
function p(float len, float freq){return audiodub(BlankClip(length=int(len*24), width=400,height=400, pixel_type="rgb32",fps=24, color=int((freq-262.0)/1.72)).addborders(20,20,20,20,$441144),tone(len,freq,channels=1,level=0.7).FadeIO0(1,0,24))}
function q(float len, float freq){return audiodub(BlankClip(length=int(len*24), width=400,height=400, pixel_type="rgb32",fps=24, color=int((freq-272.0)/1.72)).addborders(20,20,20,20,$441144),tone(len,freq,channels=1,level=0.5).FadeIO0(1,0,24))}
C=261.6255653006
D=293.6647679174
Eb=311.126984
E=329.6275569129
F=349.2282314330
Gb=369.9944227116
G=391.9954359817
Ab=415.304698
A=440.00000000001
Bb=466.163762
B=493.8833012561
c2=c*2.0
d2=d*2.0
e2=e*2.0
f2=f*2.0
N1=2.0
N2=N1/2
N4=N2/2
N8=N4/2
BlankClip(length=576, width=400,height=400, pixel_type="rgb32",fps=24, color=0).subtitle(" . * . * ",y=50,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*1,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*2,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*3,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*4,size=46,align=5, font="Courier New").subtitle(" * . * ",y=50+30*5,size=46,align=5, font="Courier New").subtitle(" . * . ",y=50+30*6,size=46,align=5, font="Courier New").subtitle("* . . * ",y=50+30*7,size=46,align=5, font="Courier New").subtitle(" . . .",y=50+30*8,size=46,align=5, font="Courier New").subtitle(" . . * . ",y=50+30*9,size=46,align=5, font="Courier New").greyscale().GeneralConvolution(0, "5 10 10 10 5 10 10 5 10 10 5 10 10 10 5 10 10 10 10 10 5 10 10 10 5 ", 200, false).crop(0,10,0,-076)
stackvertical(last,last,last,last)
sn=stackhorizontal(last,last,last)
sn= Animate(0,576,"Bicubicresize",sn, 400,400, 1./3.,1./3., 576./3., 1256.-400.,400,400, sn, 400,400, 1./3.,1./3., 0., 0.,400,400)
sn2=sn.crop(100,100,0,0).bicubicresize(400,400)
#6/8 Waltz
bassauftakt=q(N4,F/2) #auftakt has 2/8
bassline1=q(N4,e/2)+q(N8,c/2)+q(N8,d/2)+q(N4,e/2)+q(N2,f/2)+q(N4,f/2) #line has 12/8
bassline2=q(N4,Gb/2)+q(N8,d/2)+q(N8,e/2)+q(N4,Gb/2)+q(N2,g/2)+q(N4,g/2) #line has 12/8
bassline3=q(N4,Ab/2)+q(N8,E/2)+q(N8,Gb/2)+q(N4,Ab/2)+q(N4,A/2)+q(N4,F/2)+q(N4,E/2) #line has 12/8
bassline4=q(N4,F/2)+q(N4,Gb/2)+q(N4,G/2)+q(N2,C/2)+q(N4,D/2) #line has 12/8
bassline5=q(N4,c2/2)+q(N4,b/2)+q(N4,a/2)+q(N2,g/2) #short line has 10/8
bassline6=q(N4,g/2)+q(N4,a/2)+q(N4,g/2)+q(N4,f/2)+q(N4,e/2) #short line has 10/8
bassline7=q(N4,f/2)+q(N4,g/2)+q(N4,c2/2)+q(N4,g/2)+q(N4,a/2) #short line has 10/8
bassline8=q(N2,g/2)+q(N4,e/2)+q(N4,f/2)+q(N4,Gb/2)+q(N4,f/2)+q(N1,e/2) #line has 12/8
leadauftakt=p(N4,G) #auftakt has 2/8
leadline1=p(N4,c2)+p(N8,c2)+p(N8,d2)+p(N8,c2)+p(N8,B)+p(N4,a)+p(N4,a)+p(N4,a) #line has 12/8
leadline2=p(N4,d2)+p(N8,d2)+p(N8,e2)+p(N8,d2)+p(N8,c2)+p(N4,b)+p(N4,g)+p(N4,g) #line has 12/8
leadline3=p(N4,e2)+p(N8,e2)+p(N8,f2)+p(N8,e2)+p(N8,d2)+p(N4,c2)+p(N4,a)+p(N8,g)+p(N8,g) #line has 12/8
leadline4=p(N4,a)+p(N4,d2)+p(N4,b)+p(N2,c2)+p(N4,g) #line has 12/8
leadline5=p(N4,c2)+p(N4,c2)+p(N4,c2)+p(N2,b)+p(N4,b) #short line has 10/8
leadline6=p(N4,c2)+p(N4,b)+p(N4,a)+p(N2,g)+p(N4,d2) #short line has 10/8
leadline7=p(N4,e2)+p(N8,d2)+p(N8,d2)+p(N8,c2)+p(N8,c2)+p(N4,2*g)+p(N4,g) #short line has 10/8
leadline8=p(N8,g)+p(N8,g)+p(N4,a)+p(N4,d)+p(N4,b)+p(N1,c2) #line has 12/8
secauftakt=q(N4,G) #auftakt has 2/8
secline1=q(N2,e)+q(N4,c)+q(N2,F)+q(N4,G) #line has 12/8
secline2=q(N4,Gb)+q(N8,d)+q(N8,e)+q(N4,Gb)+q(N2,G)+q(N4,G) #line has 12/8
secline3=q(N4,Ab)+q(N4,E)+q(N4,Ab)+q(N4,A)+q(N4,A)+q(N4,G) #line has 12/8
secline4=q(N4,F)+q(N4,Gb)+q(N4,F)+q(N2,E)+q(N4,E) #line has 12/8
secline5=q(N4,c2)+q(N4,B)+q(N4,A)+q(N2,G) #short line has 10/8
secline6=q(N4,G)+q(N4,A)+q(N4,G)+q(N4,F)+q(N4,E) #short line has 10/8
secline7=q(N4,F)+q(N4,G)+q(N4,c2)+q(N4,G)+q(N4,A) #short line has 10/8
secline8=q(N2,G)+q(N4,E)+q(N4,F)+q(N4,Gb)+q(N4,F)+q(N1,E) #line has 12/8
bass=bassauftakt++bassline1++bassline2++bassline3++bassline4++bassline5++bassline6++bassline7++bassline8
lead=leadauftakt++leadline1++leadline2++leadline3++leadline4++leadline5++leadline6++leadline7++leadline8
sec=secauftakt++secline1++secline2++secline3++secline4++secline5++secline6++secline7++secline8
#return(bass)
left=KillVideo(lead)
right=KillVideo(sec)
center=KillVideo(bass)
stereo=MergeChannels(left,center,right)
AudioDub(lead,stereo)
Subtitle("I wish all avisynth developers and users\n a merry christmas and a happy new year!\n\nEmulgator in continuation hanfrunz 2025\n\n(And haven't we 3.0 audio going on since 1954...)", y=height*3/8, align=5, lsp=10, text_color=$ffff00, halo_color=$ff0000)
overlay(last, sn ,mode="blend", opacity=0.25, x=20, y=20).overlay(sn2,mode="blend", opacity=0.25, x=20, y=20)
waveform()#

StainlessS
1st January 2026, 14:03
Emulgator,
you aint half scuppered me there.
Your new xmas ditti has 3 audio channels, and older ones 2 channels.
How does one convert a two audio channel clip to 3 audio channels to match your latest script?
(for the "HanFrunz_XMas_Extravaganza.avs" script)

EDIT: Good job by the way. :)

EDIT: What I got so far,

# HanFrunz_XMas_Extravaganza.avs : Req AVS+, RT_Stats in Plugins
IN_FILES = ".\20??.AVS"
FAR = RT_VarExist("FAR") ? FAR : 16.0/9.0 # Required Output Frame Aspect Ratio : Defined here only if not defined by caller script
#--------------------------------------------------------------------------------
SzLimit = 1024 # Limit on shorter side by FAR [Height if FAR > 1.0, else Width]
OUT_FILE = ".\FILE.List"
FILES=RT_WriteFileList(IN_FILES,OUT_FILE)
Assert(FILES!=0, "No files found")
FILELIST=RT_ReadTxtFromFile(OUT_FILE)
RT_FileDelete(OUT_FILE)
MAXH=0 MAXW=0 MAXFPS=0 MAXAUDCH=0
For(i=0,FILES-1) { k=AviSource(RT_TxtGetLine(FILELIST,i)) MAXH = max(MAXH,k.height) MAXW = max(MAXW,k.width) MaxFPS=Max(MAXFPS,k.FrameRate) MAXAUDCH = Max(MAXAUDCH,k.AudioChannels) }

if(FAR >= MAXW / MAXH) {
canvasheight = (MAXH > SzLimit) ? SzLimit : MAXH
canvasheight = ((canvasheight + 2) / 4) * 4
canvaswidth = Int((canvasheight * FAR + 2) / 4) * 4
} else {
canvaswidth = (MAXW > SzLimit) ? SzLimit : MAXW
canvaswidth = ((canvaswidth + 2) / 4) * 4
canvasheight = Int((canvaswidth * FAR + 2) / 4) * 4
}

picclip = BlankClip(Length=0,width=canvaswidth,height=canvasheight,fps=MAXFPS,Pixel_type="YV12",Audio_Rate=48000, channels=MAXAUDCH)

For(i=0,FILES-1) {
k=AviSource(RT_TxtGetLine(FILELIST,i))
OrgH=k.height OrgW=k.width
iWidth=k.Width() iHeight=k.Height()
cFAR = float(canvaswidth) / canvasheight
iFAR = float(iWidth) / iHeight
Left=0 Top=0 Right=0 Bot=0
if(iFAR >= cFAR) {
oWid = canvaswidth
oHit = (oWid*iHeight/iWidth/4)*4
Top = (canvasheight-oHit) / 2
Bot = canvasheight - oHit - Top
} else {
oHit = canvasheight
oWid = (oHit*iWidth/iHeight/4)*4
Left = (canvaswidth-oWid) / 2
Right = canvaswidth - oWid - Left
}
k = k.BilinearResize(oWid,oHit).addborders(Left,Top,Right,Bot,0).ConvertToYV12.Changefps(MaxFPS).ResampleAudio(48000) # NEED stuff here-ish
k=k.Trim(0,0)
picclip = picclip + k
}
PicClip

Emulgator
1st January 2026, 15:26
Ah, yeah, this makes headaches at concatenation.
Yesterday I couldn't get your famous extravaganza to load the 2021 script here anymore,
and on single play the 2021 script itself did not return anything here, so I just published 2025 without that check.
Will have to dig here too, so...I thought the previous were 1-ch...yes, you would first obtain the Maxchannels, then mix up, similar as with the video properties.
Well, that 2021 CL is a 1-liner with 55610 columns, maybe too long for the usual 32K buffer ? and how did that work in the first place ?

StainlessS
1st January 2026, 16:10
2021 script fail reported here:- https://forum.doom9.org/showthread.php?p=2026407#post2026407
EDIT: Actually it was 2022.avsi that failed not 2021.

fixed

Uh-oh.
Animate (and all floats since last release) works in 64bit double precision. Animate's previously working interpolating formulas are now resulting in such interpolated values, which do not fit into the start-end range.
In this case, step 1 of 574 resulted in 360.00000000000006 which is outside the 0..360 range. The fix will be release shortly.

Sorry for the inconvenience.

Avisynth r4403.

https://github.com/pinterf/AviSynthPlus/releases/tag/v3.7.6pre-r4403

Fixed Animate, which has a glitch preventing running Xmas scripts.

20251225 3.7.5.r4403 (pre 3.7.6)

Fix: The Animate() function now explicitly clamps interpolated values to ensure they remain
strictly between the start and end range. Due to the high precision of 64-bit double introduced
in v3.7.5, intermediate calculations could slightly exceed the boundary (e.g., 360.00000000000006
when interpolating from 0 to 360.0 in 564 steps), requiring this clamp to prevent out-of-range errors.

EDIT: Latest Extravaganza whotsit posted like so

See here:- [ Hanfrunz_XMas_Extravaganza_Emulgator_PortalScope_2024.avs ] https://forum.doom9.org/showthread.php?p=2012080#post2012080

Contains all Hanfrunz scripts 2010 -> 2023 + Emulgator_PortalScope + small script to play all one after another, over 5 mins of xmas goodness.
(If you updated AVS+ recently, you need the update from yesterday (bugfix for animate floats)).



ClickMe [twice for original size]
https://i.postimg.cc/mPZ8bty0/Hanfrunz-XMas-Extravaganza-Emulgator-Portal-Scope-2024-00.jpg (https://postimg.cc/mPZ8bty0)

7z zip [24KB] contains all original scripts, + links to where posted on D9.

StainlessS
1st January 2026, 16:36
Arh crap !,
The Hanfrunz originals are single channel audio,

I guess I just assumed two channel after reading this in your script.

(And haven't we 3.0 audio going on since 1954...)

So the question remains, how does one convert single channel to 3 channel,and also 2 channel to 3 channel.
(I dont want to guess best way to do it)

TriChannel = MergeChannels(Mono,mono,mono) #maybe ?
TriChannelFromStereo=MergeChannels(Left,Silence,Right) #maybe ? (How do you extract Left, and right ?)
[EDIT: Changed MixAudio to MergeChannels]

Emulgator
1st January 2026, 17:01
Yes, just MergeChannels(left,center,right) (in your case MergeChannels(mono,mono,mono)) pipes 3x 1.0 channels side by-side as 3.0.
KillVideo()leaves you with whatever audio was with the video and pipes only that.
GetChannels(last,1) does the same for mono.
GetChannels(last,2) gets the right channel from 2.0 stereo and pipes that as 1.0 mono
(Same line onto a 3.0 would get the center channel and pipe that as 1.0 mono)
GetChannels(last,1,3) should get the left and right channel from my 3.0 and pipe as 2.0 stereo

Finally AudioDub(last,GetChannels(1,3)) makes 2.0 stereo video out of my 3.0 video, leaving the bass center out.

The version throwing faulting with AVS+ introducing 64bit precision because of Tweak: same here, and mended with 4403, was 2023.
2021: I went after the loong 1-liner and sliced it in 145 lines so far.
Found many expressions inside to be space-separated without newline...

FranceBB
2nd January 2026, 11:00
Nice one. The tradition continues. Well done. :)

StainlessS
2nd January 2026, 13:44
OK, thanx both 2 both of you.

I'll get to it in a little while, I'm compelled to go t' pub now.
Cheers :)

FranceBB
2nd January 2026, 16:32
I'm compelled to go t' pub now.

I'd come with you, but I'm currently in the office halfway through my shift, so I can't :(
Ironically in Scotland they get both days off (I mean New Year's day and the second, so all our Scottish colleagues are off and probably laughing at us right now).

StainlessS
2nd January 2026, 22:19
halfway through my shift
Me dont got dat der work thingy, retired 4 years now (@66), I think if I were born a couple of years later then would not retire till 68,
and the nippers coming up now will probably not retire till 70 or 80 YO. {he-he-he :) }

EDIT: However, by then they will probably be getting those weird octopuss [EDIT: Jellyfish] gene injections and live forever.

The Incredible Way This Jellyfish Goes Back in Time:- https://www.youtube.com/watch?v=DSLQYTt8BjA

StainlessS
8th January 2026, 16:14
Sorry guys, got a bit waylaid.
Hanfrunz_XMas_Extravaganza_Emulgator_PortalScope_2025:-
https://www.mediafire.com/file/npzz9500lj7zgtc/Hanfrunz_XMas_Extravaganza_Emulgator_PortalScope_2025.7z/file
5:37.08 of xmas goodness.


Hanfrunz_XMas_Extravaganza.avs fixed for mono and tri-channels as so,


# HanFrunz_XMas_Extravaganza.avs : Req AVS+, RT_Stats in Plugins
IN_FILES = ".\20??.AVS"
FAR = RT_VarExist("FAR") ? FAR : 16.0/9.0 # Required Output Frame Aspect Ratio : Defined here only if not defined by caller script
#--------------------------------------------------------------------------------
SzLimit = 1024 # Limit on shorter side by FAR [Height if FAR > 1.0, else Width]
OUT_FILE = ".\FILE.List"
FILES=RT_WriteFileList(IN_FILES,OUT_FILE)
Assert(FILES!=0, "No files found")
FILELIST=RT_ReadTxtFromFile(OUT_FILE)
RT_FileDelete(OUT_FILE)
MAXH=0 MAXW=0 MAXFPS=0 MAXAUDCH=0
For(i=0,FILES-1) { k=AviSource(RT_TxtGetLine(FILELIST,i)) MAXH = max(MAXH,k.height) MAXW = max(MAXW,k.width) MaxFPS=Max(MAXFPS,k.FrameRate) MAXAUDCH = Max(MAXAUDCH,k.AudioChannels) }

if(FAR >= MAXW / MAXH) {
canvasheight = (MAXH > SzLimit) ? SzLimit : MAXH
canvasheight = ((canvasheight + 2) / 4) * 4
canvaswidth = Int((canvasheight * FAR + 2) / 4) * 4
} else {
canvaswidth = (MAXW > SzLimit) ? SzLimit : MAXW
canvaswidth = ((canvaswidth + 2) / 4) * 4
canvasheight = Int((canvaswidth * FAR + 2) / 4) * 4
}

picclip = BlankClip(Length=0,width=canvaswidth,height=canvasheight,fps=MAXFPS,Pixel_type="YV12",Audio_Rate=48000,sample_type="16bit",channels=MAXAUDCH)

For(i=0,FILES-1) {
k=AviSource(RT_TxtGetLine(FILELIST,i))
OrgH=k.height OrgW=k.width
iWidth=k.Width() iHeight=k.Height()
cFAR = float(canvaswidth) / canvasheight
iFAR = float(iWidth) / iHeight
Left=0 Top=0 Right=0 Bot=0
if(iFAR >= cFAR) {
oWid = canvaswidth
oHit = (oWid*iHeight/iWidth/4)*4
Top = (canvasheight-oHit) / 2
Bot = canvasheight - oHit - Top
} else {
oHit = canvasheight
oWid = (oHit*iWidth/iHeight/4)*4
Left = (canvaswidth-oWid) / 2
Right = canvaswidth - oWid - Left
}
k = k.BilinearResize(oWid,oHit).addborders(Left,Top,Right,Bot,0).ConvertToYV12.Changefps(MaxFPS).ConvertAudioTo16bit().ResampleAudio(48000)
kCh = k.AudioChannels
if(kCh != MAXAUDCH) { # Only support up to 3 channels max
Silence = k.BlankClip(channels=1).KillVideo
Aud = k.KillVideo
# WARN ... Cannot Use Select() as each path is evaluated and can give errors where channels do not exist.
if(MAXAUDCH==1) {
Aud = Silence
} Else If(MAXAUDCH==2) {
Aud = (kCh==0) ? MergeChannels(Silence,Silence) : MergeChannels(k.Getchannel(1),k.Getchannel(1))
} Else If(MAXAUDCH==3) {
Aud = (kCh==0) ? MergeChannels(Silence,Silence,Silence) : (kCh==1) ? MergeChannels(Silence,k.Getchannel(1),Silence) : MergeChannels(k.Getchannel(1),Silence,k.Getchannel(2))
}
k=AudioDubEx(k,Aud)
}
k = k.Trim(0,0)
picclip = picclip + k
}
PicClip


Mono channel inserted as middle channel when any avs xmas script is tri-channel.
Stereo inserted as left and right channels when any avs xmas script is tri-channel (middle = silence).
All early xmas scripts are mono only with 2025 being tri-channel. (no stereo scripts so far).


EDIT: Also contained in 7z,

:: Hanfrunz
2010:- https://forum.doom9.org/showthread.php?t=158676
2011:- https://forum.doom9.org/showthread.php?t=163597
2012:- https://forum.doom9.org/showthread.php?t=166752
2013:- https://forum.doom9.org/showthread.php?t=169943
2014:- https://forum.doom9.org/showthread.php?t=171573
2015:- https://forum.doom9.org/showthread.php?t=172979
2016:- https://forum.doom9.org/showthread.php?t=174134
2017:- https://forum.doom9.org/showthread.php?p=1827786
2018:- https://forum.doom9.org/showthread.php?t=175966
2019:- https://forum.doom9.org/showthread.php?t=177183
2020:- https://forum.doom9.org/showthread.php?t=182190
2021:- https://forum.doom9.org/showthread.php?t=183555
2022:- https://forum.doom9.org/showthread.php?t=184633
2023:- https://forum.doom9.org/showthread.php?t=185220
:: Emulgator
:: Portalscope:- https://forum.doom9.org/showthread.php?p=2012064
2024:- https://forum.doom9.org/showthread.php?p=2012066
2025:- https://forum.doom9.org/showthread.php?p=2026620


If you get a "Read Error" error, then need AVS+ update to current.