It is currently August 5th, 2020, 1:52 pm

Image Audio Visualizer

Help with creating, editing & fixing problems with skins
MashedPotato
Posts: 5
Joined: February 14th, 2018, 8:18 am

Image Audio Visualizer

Post by MashedPotato »

Hi! Sorry if this question is too simple, but I just can't find the solution. This is my first attempt at making a skin. Would be really awesome if someone could help! Thanks!

What I'm trying to do is set an Image to show only when a certain Hz is reached(Bass). So It kinda works, except it doesn't read the Frequency options.


[MeasureAudioBase]
Measure=Plugin
Plugin=AudioLevel
Port=Output
FFTSize=1024
FFTAttack=15
FFTDecay=100
Sensitivity=10
FreqMin=0
FreqMax=20
Type=FFT

[MeterHeart]
Meter=Image
ImageName=#@#Bloody Yandare Chan~.png
X=0
Y=0
W=1366
H=768
PreserveAspectRatio=0
Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255))
Imagetint=255,255,255
Antialias=1
DynamicVariables=1
User avatar
balala
Rainmeter Sage
Posts: 11156
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image Audio Visualizer

Post by balala »

MashedPotato wrote:What I'm trying to do is set an Image to show only when a certain Hz is reached(Bass). So It kinda works, except it doesn't read the Frequency options.
Not sure what you mean by "it doesn't read the Frequency options". For me the [MeasureAudioBase] measure works well.
On the other hand, there is a problem in the ImageAlpha option of the [MeterHeart] image meter. There is missing a comma: replace the Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255)) option with Imagealpha=(Clamp(([MeasureAudioBase]*255)[color=#FF0000],[/color]0,255)). I colored red the missing comma.
MashedPotato
Posts: 5
Joined: February 14th, 2018, 8:18 am

Re: Image Audio Visualizer

Post by MashedPotato »

balala wrote:Not sure what you mean by "it doesn't read the Frequency options". For me the [MeasureAudioBase] measure works well.
On the other hand, there is a problem in the ImageAlpha option of the [MeterHeart] image meter. There is missing a comma: replace the Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255)) option with Imagealpha=(Clamp(([MeasureAudioBase]*255)[color=#FF0000],[/color]0,255)). I colored red the missing comma.
Thanks for the quick reply. Unfortunately, It didn't work. What I meant by Frequency options are the "FreqMin/Max", Deleting them or setting them to zero will not change anything, however changing Sensitivity does, the low sensitivity makes it seem that it works. It appears and immediately disappears even when there's not much bass, which just ruins it.

I'm trying to make a Yandere Simulator wallpaper. In the game menu, after waiting for a while there are flashes of Yandere Chan going berserk and bloody. It would be really awesome for it to show on the bass drop, that's what I'm trying to do.

EDIT: The missing comma is not necessarily needed, it has the same effect whether its there or not.
User avatar
balala
Rainmeter Sage
Posts: 11156
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image Audio Visualizer

Post by balala »

MashedPotato wrote:EDIT: The missing comma is not necessarily needed, it has the same effect whether its there or not.
Disagree!!! :17denial The function without the comma, can't work.

About the FreqMin/FreqMax, try to increase their values. Try FreqMin=20 and FreqMax=100. Finally when the frequency is 0, there is no sound.
MashedPotato
Posts: 5
Joined: February 14th, 2018, 8:18 am

Re: Image Audio Visualizer

Post by MashedPotato »

balala wrote:Disagree!!! :17denial The function without the comma, can't work.

About the FreqMin/FreqMax, try to increase their values. Try FreqMin=20 and FreqMax=100. Finally when the frequency is 0, there is no sound.


I use this to check. Even when the FreqMin/Max are set to 20-100, the image starts appearing around 270Hz.
What I meant by setting Freq to 0 is that it doesn't change anything, even deleting that part of the code doesn't change a thing. Sensitivity is the one in control :confused:

Code: Select all

[Rainmeter]
Update=16
DynamicWindowSize=1

[Metadata]
Name=Bloody Cut(Yandare Background)
Author=IkiruRiyu
Information=Background Bass Visualizer
Version=1.0

[MeasureAudioBase]
Measure=Plugin
Plugin=AudioLevel
Port=Output
FFTSize=1024
FFTAttack=15
FFTDecay=100
FreqMin=20
FreqMax=50
Sensitivity=30
Type=FFT

[MeterHeart]
Meter=Image
ImageName=#@#Bloody Chan~.png
X=0
Y=0
W=1366
H=768
PreserveAspectRatio=0
Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255))
Imagetint=255,255,255
Antialias=0
DynamicVariables=1
User avatar
CyberTheWorm
Posts: 714
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Image Audio Visualizer

Post by CyberTheWorm »

Code: Select all

ImageName=#@#Bloody Chan~.png
Will not work as it has a space in the file name

try this edit in red

Code: Select all

ImageName=#@#[color=#FF0000]"[/color]Bloody Chan~.png[color=#FF0000]"[/color]
Or you could rename the file so it does not have spaces
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
CyberTheWorm
Posts: 714
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Image Audio Visualizer

Post by CyberTheWorm »

CyberTheWorm wrote:

Code: Select all

ImageName=#@#Bloody Chan~.png
Will not work as it has a space in the file name

try this edit adding quotes around the file name

Code: Select all

ImageName=#@#"Bloody Chan~.png"
Or you could rename the file so it does not have spaces
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
jsmorley
Developer
Posts: 21212
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Image Audio Visualizer

Post by jsmorley »

CyberTheWorm wrote:

Code: Select all

ImageName=#@#Bloody Chan~.png
Will not work as it has a space in the file name

try this edit in red

Code: Select all

ImageName=#@#[color=#FF0000]"[/color]Bloody Chan~.png[color=#FF0000]"[/color]
Or you could rename the file so it does not have spaces
Sorry, but this is bad advice. Not only does it try to solve a problem that doesn't exist, but the solution just won't work in any case...

Actually, spaces are not an issue with any option value in Rainmeter...

ImageName=#@#Bloody Chan~.png
ImageName="#@#Bloody Chan~.png"

Those are actually the same, and both work. Any leading and trailing "quotes" on any option value in Rainmeter are just automatically stripped off before the value is even evaluated.

When spaces DO become an issue, and when you need to use "quotes" to deal with them, is in parameters in a bang.

LeftMouseUpAction=[!SetOption MyImageMeter ImageName #@#Bloody Chan~.png]

That will fail, as there is an optional "config" parameter on almost all bangs, and with that space in the file name, Rainmeter can't tell if Chan~.png is a part of the file name, or the name of a config to apply the bang to. You would need to use:

LeftMouseUpAction=[!SetOption MyImageMeter ImageName "#@#Bloody Chan~.png"]

But again, quotes are NEVER needed on any option value in Rainmeter, unless the quotes are part of the functionality, like with Substitute, and in some cases RunCommand.

With option values, even paths to files, there can be no ambiguity, as an option value is always a single thing.

ImageName=#@#Bloody Chan~.png

There can be no doubt that that value represents a path to a file, and Rainmeter doesn't need, and ignores entirely, any quotes around it.

And sorry, but in particular, this:

ImageName=#@#"Bloody Chan~.png"

Just won't work, as that is not a valid path in Windows. Windows will just not understand a value like

C:\Users\YourName\Documents\Skins\MySkin\@Resources\"Bloody Chan~.png"

And will fail with a "file not found". A path must be entirely enclosed in quotes when quotes are needed by Windows, like when using a path as a parameter to a function in a Windows cmd.exe console. But again, quotes are just not needed for paths in option values in Rainmeter.
User avatar
fonpaolo
Moderator
Posts: 1397
Joined: April 11th, 2013, 8:08 pm
Location: Italy

Re: Image Audio Visualizer

Post by fonpaolo »

Well... this: Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255)) does nothing, only because it's wrong.

ImageAlpha needs only the Alpha value, not all the values.
"Opacity of the image ranging from 0 (invisible) to 255 (opaque). If set, this overrides the alpha component specified in ImageTint."
User avatar
balala
Rainmeter Sage
Posts: 11156
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Image Audio Visualizer

Post by balala »

fonpaolo wrote:Well... this: Imagealpha=(Clamp(([MeasureAudioBase]*255)0,255)) does nothing, only because it's wrong.

ImageAlpha needs only the Alpha value, not all the values.
"Opacity of the image ranging from 0 (invisible) to 255 (opaque). If set, this overrides the alpha component specified in ImageTint."
But there is only the Alpha value. There are no three (or four) values. But that value is included into a Clamp function.
What is wrong and I still say it's wrong, is the missing comma, marked below red: Imagealpha=(Clamp(([MeasureAudioBase]*255)[color=#FF0000],[/color]0,255)).