raffriff42
6th September 2015, 02:15
Do you need an 18 band audio spectrum analyzer (or analyser)? Of course you do. :rolleyes:
https://www.dropbox.com/s/m03z9f6zvlh5dqs/Avisynth-spectrum-analyzer-04.jpg?raw=1
What is it worth to you? Oh, nothing, huh? Well okay, here you go.
No plugins needed, just vanilla Avisynth...
(It's just for fun, and to demonstrate SuperEQ (http://avisynth.nl/index.php/SuperEQ))
(Only tested on Avisynth 2.60 at the moment; AVS+ has a problem (http://forum.doom9.org/showthread.php?p=1737382#post1737382))
(EDIT April 2016 - fixed! (http://forum.doom9.org/showthread.php?p=1763706#post1763706) But SuperEQ is not supported on AVS+ ?)
V=ColorBarsHD ## any video
A=V ## any audio
Z=Analyzer18(V, A)
\ .ChangeFPS(V) ## return to original framerate
Overlay(V, Z,
\ x=V.Width/2-Z.Width/2,
\ y=V.Height-Z.Height,
\ opacity=1.0,
\ mode="blend")
AudioDub(A)
ConvertAudioTo16bit ## optional, rq'd for VirtualDub
return Last
# http://forum.doom9.org/showthread.php?t=172569
##################################
### 18 Band Audio Spectrum Analyzer
##
## @ updatefps - set according to available compute power; default 5
##
## @ return YV12, 640x334, fps=(updatefps)
##
function Analyzer18(clip V, clip A, int "updatefps")
{
updatefps = Default(updatefps, 5)
BlankClip(V, width=640, height=480, pixel_type="YV12")
AudioDub(A)
ConvertToMono
ConvertAudioToFloat
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
B01=SuperEQ( 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B02=SuperEQ(-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B03=SuperEQ(-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B04=SuperEQ(-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B05=SuperEQ(-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B06=SuperEQ(-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B07=SuperEQ(-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B08=SuperEQ(-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B09=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B10=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99)
B11=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99)
B12=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99)
B13=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99)
B14=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99)
B15=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99)
B16=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99)
B17=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99)
B18=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0)
MergeChannels(B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15, B16, B17, B18)
ChangeFPS(updatefps)
Histogram("audiolevels") ## the magic happens
Crop(0, 0, 640, 326) ## crop off some crud
AddBorders(0, 8, 0, 0) ## top border
yy = Height-8
cc = color_yellow
Subtitle("0 - 65", x=16, y=yy, font_angle=90, text_color=cc)
Subtitle("65 - 93", x=48, y=yy, font_angle=90, text_color=cc)
Subtitle("93 - 131", x=78, y=yy, font_angle=90, text_color=cc)
Subtitle("131 -185", x=108, y=yy, font_angle=90, text_color=cc)
Subtitle("185 -262", x=142, y=yy, font_angle=90, text_color=cc)
Subtitle("262 -370", x=172, y=yy, font_angle=90, text_color=cc)
Subtitle("370 -523", x=206, y=yy, font_angle=90, text_color=cc)
Subtitle("523 -740", x=238, y=yy, font_angle=90, text_color=cc)
Subtitle("740 -1047", x=268, y=yy, font_angle=90, text_color=cc)
Subtitle("1047-1480", x=300, y=yy, font_angle=90, text_color=cc)
Subtitle("1480-2093", x=332, y=yy, font_angle=90, text_color=cc)
Subtitle("2093-2960", x=366, y=yy, font_angle=90, text_color=cc)
Subtitle("2960-4186", x=396, y=yy, font_angle=90, text_color=cc)
Subtitle("4186-5920", x=426, y=yy, font_angle=90, text_color=cc)
Subtitle("5920-8372", x=456, y=yy, font_angle=90, text_color=cc)
Subtitle("8372-11k8", x=490, y=yy, font_angle=90, text_color=cc)
Subtitle("11k8-16k7", x=526, y=yy, font_angle=90, text_color=cc)
Subtitle("16k7-22ką", x=558, y=yy, font_angle=90, text_color=cc)
return Last
}
https://www.dropbox.com/s/m03z9f6zvlh5dqs/Avisynth-spectrum-analyzer-04.jpg?raw=1
What is it worth to you? Oh, nothing, huh? Well okay, here you go.
No plugins needed, just vanilla Avisynth...
(It's just for fun, and to demonstrate SuperEQ (http://avisynth.nl/index.php/SuperEQ))
(Only tested on Avisynth 2.60 at the moment; AVS+ has a problem (http://forum.doom9.org/showthread.php?p=1737382#post1737382))
(EDIT April 2016 - fixed! (http://forum.doom9.org/showthread.php?p=1763706#post1763706) But SuperEQ is not supported on AVS+ ?)
V=ColorBarsHD ## any video
A=V ## any audio
Z=Analyzer18(V, A)
\ .ChangeFPS(V) ## return to original framerate
Overlay(V, Z,
\ x=V.Width/2-Z.Width/2,
\ y=V.Height-Z.Height,
\ opacity=1.0,
\ mode="blend")
AudioDub(A)
ConvertAudioTo16bit ## optional, rq'd for VirtualDub
return Last
# http://forum.doom9.org/showthread.php?t=172569
##################################
### 18 Band Audio Spectrum Analyzer
##
## @ updatefps - set according to available compute power; default 5
##
## @ return YV12, 640x334, fps=(updatefps)
##
function Analyzer18(clip V, clip A, int "updatefps")
{
updatefps = Default(updatefps, 5)
BlankClip(V, width=640, height=480, pixel_type="YV12")
AudioDub(A)
ConvertToMono
ConvertAudioToFloat
## 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
B01=SuperEQ( 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B02=SuperEQ(-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B03=SuperEQ(-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B04=SuperEQ(-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B05=SuperEQ(-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B06=SuperEQ(-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B07=SuperEQ(-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B08=SuperEQ(-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B09=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99,-99)
B10=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99,-99)
B11=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99,-99)
B12=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99,-99)
B13=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99,-99)
B14=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99,-99)
B15=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99,-99)
B16=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99,-99)
B17=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0,-99)
B18=SuperEQ(-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99,-99, 0)
MergeChannels(B01, B02, B03, B04, B05, B06, B07, B08, B09, B10, B11, B12, B13, B14, B15, B16, B17, B18)
ChangeFPS(updatefps)
Histogram("audiolevels") ## the magic happens
Crop(0, 0, 640, 326) ## crop off some crud
AddBorders(0, 8, 0, 0) ## top border
yy = Height-8
cc = color_yellow
Subtitle("0 - 65", x=16, y=yy, font_angle=90, text_color=cc)
Subtitle("65 - 93", x=48, y=yy, font_angle=90, text_color=cc)
Subtitle("93 - 131", x=78, y=yy, font_angle=90, text_color=cc)
Subtitle("131 -185", x=108, y=yy, font_angle=90, text_color=cc)
Subtitle("185 -262", x=142, y=yy, font_angle=90, text_color=cc)
Subtitle("262 -370", x=172, y=yy, font_angle=90, text_color=cc)
Subtitle("370 -523", x=206, y=yy, font_angle=90, text_color=cc)
Subtitle("523 -740", x=238, y=yy, font_angle=90, text_color=cc)
Subtitle("740 -1047", x=268, y=yy, font_angle=90, text_color=cc)
Subtitle("1047-1480", x=300, y=yy, font_angle=90, text_color=cc)
Subtitle("1480-2093", x=332, y=yy, font_angle=90, text_color=cc)
Subtitle("2093-2960", x=366, y=yy, font_angle=90, text_color=cc)
Subtitle("2960-4186", x=396, y=yy, font_angle=90, text_color=cc)
Subtitle("4186-5920", x=426, y=yy, font_angle=90, text_color=cc)
Subtitle("5920-8372", x=456, y=yy, font_angle=90, text_color=cc)
Subtitle("8372-11k8", x=490, y=yy, font_angle=90, text_color=cc)
Subtitle("11k8-16k7", x=526, y=yy, font_angle=90, text_color=cc)
Subtitle("16k7-22ką", x=558, y=yy, font_angle=90, text_color=cc)
return Last
}