It is currently March 28th, 2024, 9:44 am

AudioRMS

General topics related to Rainmeter.
Post Reply
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

AudioRMS

Post by CyberTheWorm »

Have a question to see if this is possible.
I have made skins with vertical and horizontal bars that will display the left and right channels.
Is it possible to do the same with a circular image where it displays a portion of the circle starting from the center going to the edge?
Last edited by CyberTheWorm on February 2nd, 2017, 7:11 pm, edited 1 time in total.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: AudioRMS

Post by balala »

I suppose you're talking about an audio visualizer skin, right?
Probably it's possible. You should use a Roundline meter and control dynamically its LineLength option.
For first, please post the code you have, with those bar meters.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: AudioRMS

Post by CyberTheWorm »

No code yet, but I'll give it a shot and see
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: AudioRMS

Post by CyberTheWorm »

OK not what I wanted but it does change 3 different colours (Yes that is the correct spelling).

Code: Select all

[Rainmeter]
Update=50

[Metadata]
Author=Graham Wedepohl
Version=1.1.0
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Viz test

[MeasureAudioRMS]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=100
RMSDecay=300
RMSGain=2.5

[MeasureLeft]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioRMS
Channel=L
Type=RMS

[MeasureRight]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudioRMS
Channel=R
Type=RMS

[MeasureFillColorLeft]
Measure=Calc
Formula=MeasureLeft*100
IfBelowValue=45
IfBelowAction=[!SetOption MeterLeft LineColor 0,255,0,255][!Redraw]
IfEqualValue=46
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=47
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=48
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=49
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=50
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=51
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=52
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=53
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfEqualValue=54
IfEqualAction=[!SetOption MeterLeft LineColor 255,255,0,255][!Redraw]
IfAboveValue=55
IfAboveAction=[!SetOption MeterLeft LineColor 255,0,0,255][!Redraw]

[MeasureFillColorRight]
Measure=Calc
Formula=MeasureRight*100
IfBelowValue=45
IfBelowAction=[!SetOption MeterRight LineColor 0,255,0,255][!Redraw]
IfEqualValue=46
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=47
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=48
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=49
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=50
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=51
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=52
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=53
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfEqualValue=54
IfEqualAction=[!SetOption MeterRight LineColor 255,255,0,255][!Redraw]
IfAboveValue=55
IfAboveAction=[!SetOption MeterRight LineColor 255,0,0,255][!Redraw]

[MeterLeft]
MeasureName=MeasureFillColorLeft
Meter=RoundLine
X=10
Y=0
W=100
H=100
StartAngle=(rad(90))
RotationAngle=(rad(360))
LineLength=50
Solid=1
AntiAlias=1

[MeterRight]
MeasureName=MeasureFillColorRight
Meter=RoundLine
X=110
Y=0
W=100
H=100
StartAngle=(rad(90))
RotationAngle=(rad(-360))
LineLength=50
Solid=1
AntiAlias=1
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: AudioRMS

Post by balala »

On a single measure, one single IfEqualValue / IfEqualAction options pair can be used. On the [MeasureFillColorLeft] and [MeasureFillColorRight] measures, you've used 9 - 9 pairs, which makes them to not work. That's one reason why I say that the IfConditions are much better. You can use any number of them onto a single measure, just have to number them. So, replace the mentioned two measures with the following ones:

Code: Select all

[MeasureFillColorLeft]
Measure=Calc
Formula=MeasureLeft*100
IfCondition=(MeasureFillColorLeft<45)
IfTrueAction=[!SetOption MeterLeft LineColor 0,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition2=(MeasureFillColorLeft=46)
IfTrueAction2=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition3=(MeasureFillColorLeft=47)
IfTrueAction3=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition4=(MeasureFillColorLeft=48)
IfTrueAction4=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition5=(MeasureFillColorLeft=49)
IfTrueAction5=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition6=(MeasureFillColorLeft=50)
IfTrueAction6=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition7=(MeasureFillColorLeft=51)
IfTrueAction7=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition8=(MeasureFillColorLeft=52)
IfTrueAction8=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition9=(MeasureFillColorLeft=53)
IfTrueAction9=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition10=(MeasureFillColorLeft=54)
IfTrueAction10=[!SetOption MeterLeft LineColor 255,255,0,255][!UpdateMeter "MeterLeft"][!Redraw]
IfCondition11=(MeasureFillColorLeft>54)
IfTrueAction11=[!SetOption MeterLeft LineColor 255,0,0,255][!UpdateMeter "MeterLeft"][!Redraw]

[MeasureFillColorRight]
Measure=Calc
Formula=MeasureRight*100
IfCondition=(MeasureFillColorRight<45)
IfTrueAction=[!SetOption MeterRight LineColor 0,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition2=(MeasureFillColorRight=46)
IfTrueAction2=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition3=(MeasureFillColorRight=47)
IfTrueAction3=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition4=(MeasureFillColorRight=48)
IfTrueAction4=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition5=(MeasureFillColorRight=49)
IfTrueAction5=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition6=(MeasureFillColorRight=50)
IfTrueAction6=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition7=(MeasureFillColorRight=51)
IfTrueAction7=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition8=(MeasureFillColorRight=52)
IfTrueAction8=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition9=(MeasureFillColorRight=53)
IfTrueAction9=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition10=(MeasureFillColorRight=54)
IfTrueAction10=[!SetOption MeterRight LineColor 255,255,0,255][!UpdateMeter "MeterRight"][!Redraw]
IfCondition11=(MeasureFillColorRight>54)
IfTrueAction11=[!SetOption MeterRight LineColor 255,0,0,255][!UpdateMeter "MeterRight"][!Redraw]
Note that in each IfTrueAction option I added an [!UpdateMeter "MeterLeft"] respectively an [!UpdateMeter "MeterRight"] bang, to update the appropriate meters, then redraw them. If they are not updated, redrawing them is useless.
Then, you're using the values returned by these measures as the MeasureName option of the [MeterLeft] and [MeterRight] meters. But the measures used as MeasureName into a Roundline meter (or a Bar one) should return percentual values. [MeasureFillColorLeft] and [MeasureFillColorRight] don't return such values. To make them to do so, add to the [MeasureFillColorLeft] and [MeasureFillColorRight] measures a MinValue=0 and a MaxValue=100 option, to set the smallest and largest value of these measures. You have to do this, because [MeasureLeft] and [MeasureRight] are returning values between 0 and 1, and the [MeasureFillColorLeft] and [MeasureFillColorRight] measures, multiply these values by 100, so their values are between 0 and 100.
And one more: in your initial measures, even if the IfActions would be working, they was set wrong, because you had IfBelowValue=45 respectively IfEqualValue=46, which means that you don't have set a condition for 45. IfBelowValue=45 means up to 44 (including) but not 45 as well.
User avatar
CyberTheWorm
Posts: 860
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: AudioRMS

Post by CyberTheWorm »

Thanks balala, I did try your suggestion but it never seemed to display anything in yellow. I did try that myself and could not get it to work either.

I'll try something different and revisit this later.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: AudioRMS

Post by balala »

CyberTheWorm wrote:Thanks balala, I did try your suggestion but it never seemed to display anything in yellow. I did try that myself and could not get it to work either.
I'm not sure why, but the values returned by the [MeasureLeft] and [MeasureRight] measures are too small. As such, the values of the [MeasureFillColorLeft] and [MeasureFillColorRight] measures are also varying around a few units, from 100.
You have two possibilities:
  • Try to increase the RMSGain value of the [MeasureAudioRMS] measure. Try it at 25.
  • Try to replace the value 100 in the Formula options of the [MeasureFillColorLeft] and [MeasureFillColorRight] measures with a larger value, let's say 1000.
Post Reply