It is currently March 28th, 2024, 4:06 pm

AudioLevel Image Opacity, only when certain frequency

Get help with creating, editing & fixing problems with skins
Post Reply
NFdotAVI
Posts: 1
Joined: July 13th, 2018, 2:50 pm

AudioLevel Image Opacity, only when certain frequency

Post by NFdotAVI »

:welcome:

I have a simple "skin" (copied code from somewhere than edited it), where an image blinks to the beat.

Code: Select all

[Rainmeter]
Update=25

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Channel=Sum
Port=Output
RMSAttack=2
RMSDecay=250
RMSGain=3.5

[meterBackground]
Meter=IMAGE
ImageName=Background.png
BackgroundMode=1
antialias=1
ImageTint=255,255,255,150
X=0
Y=0
H=400
ImageAlpha=(Clamp(([MeasureAudio]*255),30,255))
DynamicVariables=1
I'm glad it works, but after some, it got a little boring so I tried putting a second image there. Second image that will be in the foreground (the original "Backgroung.png" in background), but the foreground image would only if the sub-bass frequencies (the first image scans the entire spectrum, the second only sub-bass frequencies - from 20 Hz to 60 Hz, I believe) are very high (so it's only either opacity 0 or 255). I tried some things, but I don't really understand them and I always ended up creating exact clone of the first image, only written some other way or them switching places somehow...

So is there a way to do it? Because I just can't seem to be able to find the right way to tell the program to do so and I've been playng with it for quite some time now... Just two images...

If anyone would be able and so kind to somehow help or explain, I'd be very glad. Thanks in advance.

i hope google translate got everything explainable...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5382
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA
Contact:

Re: AudioLevel Image Opacity, only when certain frequency

Post by eclectic-tech »

You need to specify RMS, frequency, and bands settings in the audiolevel parent measure, then create child measures to obtain specific types of info; one for RMS and one for FFT.

You can tweak the values for sensitivity and RMS gain, but this should get you close. :welcome:

Code: Select all

[Rainmeter]
Update=25

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=OutPut
; ID=
RMSAttack=10
RMSDecay=300
RMSGain=2
FFTSize=512
FFTOverlap=0
FFTAttack=10
FFTDecay=10
Bands=1
FreqMin=20
FreqMax=40
Sensitivity=30
; Documentation: https://docs.rainmeter.net/manual-beta/plugins/audiolevel/

[MeasureAudioRMS]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=Sum
Type=RMS

[MeasureAudioFFT]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=Sum
BandIdx=0
Type=Band

[meterBackground]
Meter=IMAGE
ImageName=Background.png
;BackgroundMode=1
;antialias=1
ImageTint=255,255,255
X=0
Y=0
ImageAlpha=(Clamp(([MeasureAudioRMS]*300),0,255))
DynamicVariables=1

[meterForeground]
Meter=IMAGE
ImageName=Foreground.png
;BackgroundMode=1
;antialias=1
ImageTint=255,0,0
X=0
Y=R
ImageAlpha=(Clamp((([MeasureAudioFFT]*2)*300),0,255))
DynamicVariables=1
Addendum:
Backgroundmode and antialias have no effect on image meters, so I removed those.
Remove alpha value from ImageTint, it is controlled by the audiolevel.
I place the foreground meter below the other to be able to see the difference between RMS and FFT; you can reposition when you are happy with the response.
Post Reply