It is currently February 23rd, 2024, 4:16 am

SoundLevel

Media controls, music players, video and animated visualizers
User avatar
jsmorley
Developer
Posts: 22620
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

SoundLevel

Post by jsmorley »

This is a simple skin that demonstrates the new AudioLevel plugin from dgrace. Left click skin to test L/R channels.

As the plugin is still somewhat evolving, you will need to get the latest version of the plugin .dll from AudioLevel Plugin.

Code: Select all

[Rainmeter]
Update=15
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=SoundLevel
Author=JSMorley
Version=July 22, 2014
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=Demonstration of new AudioLevel Plugin from dgrace||Left click to test channels||Latest version of the plugin is available at:|http://rainmeter.net/forum/viewtopic.php?p=101823#p101823

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=100
RMSDecay=300
RMSGain=2.5
PeakAttack=15
PeakDecay=2700
PeakGain=1.0

[MeasureL]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS
IfCondition=MeasureL = 0
IfTrueAction=[!SetOption MeterL ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureL > 0) && (MeasureL < 0.1332)
IfTrueAction2=[!SetOption MeterL ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureL >= 0.1332) && (MeasureL < 0.1998)
IfTrueAction3=[!SetOption MeterL ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureL >= 0.1998) && (MeasureL < 0.2664)
IfTrueAction4=[!SetOption MeterL ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureL >= 0.2664) && (MeasureL < 0.3333)
IfTrueAction5=[!SetOption MeterL ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureL >= 0.3333) && (MeasureL < 0.3996)
IfTrueAction6=[!SetOption MeterL ImageName "5.png"][!UpdateMeter *][!Redraw]
IfCondition7=(MeasureL >= 0.3996) && (MeasureL < 0.4662)
IfTrueAction7=[!SetOption MeterL ImageName "6.png"][!UpdateMeter *][!Redraw]
IfCondition8=(MeasureL >= 0.4662) && (MeasureL < 0.5328)
IfTrueAction8=[!SetOption MeterL ImageName "7.png"][!UpdateMeter *][!Redraw]
IfCondition9=(MeasureL >= 0.5328) && (MeasureL < 0.5994)
IfTrueAction9=[!SetOption MeterL ImageName "8.png"][!UpdateMeter *][!Redraw]
IfCondition10=(MeasureL >= 0.5994) && (MeasureL < 0.6666)
IfTrueAction10=[!SetOption MeterL ImageName "9.png"][!UpdateMeter *][!Redraw]
IfCondition11=(MeasureL >= 0.6666) && (MeasureL < 0.7326)
IfTrueAction11=[!SetOption MeterL ImageName "10.png"][!UpdateMeter *][!Redraw]
IfCondition12=(MeasureL >= 0.7326) && (MeasureL < 0.7992)
IfTrueAction12=[!SetOption MeterL ImageName "11.png"][!UpdateMeter *][!Redraw]
IfCondition13=(MeasureL >= 0.7992) && (MeasureL < 0.8658)
IfTrueAction13=[!SetOption MeterL ImageName "12.png"][!UpdateMeter *][!Redraw]
IfCondition14=(MeasureL >= 0.8658) && (MeasureL < 0.9324)
IfTrueAction14=[!SetOption MeterL ImageName "13.png"][!UpdateMeter *][!Redraw]
IfCondition15=(MeasureL >= 0.9324)
IfTrueAction15=[!SetOption MeterL ImageName "14.png"][!UpdateMeter *][!Redraw]

[MeasureR]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=R
Type=RMS
IfCondition=MeasureR = 0
IfTrueAction=[!SetOption MeterR ImageName "0.png"][!UpdateMeter *][!Redraw]
IfCondition2=(MeasureR > 0) && (MeasureR < 0.1332)
IfTrueAction2=[!SetOption MeterR ImageName "1.png"][!UpdateMeter *][!Redraw]
IfCondition3=(MeasureR >= 0.1332) && (MeasureR < 0.1998)
IfTrueAction3=[!SetOption MeterR ImageName "2.png"][!UpdateMeter *][!Redraw]
IfCondition4=(MeasureR >= 0.1998) && (MeasureR < 0.2664)
IfTrueAction4=[!SetOption MeterR ImageName "3.png"][!UpdateMeter *][!Redraw]
IfCondition5=(MeasureR >= 0.2664) && (MeasureR < 0.3333)
IfTrueAction5=[!SetOption MeterR ImageName "4.png"][!UpdateMeter *][!Redraw]
IfCondition6=(MeasureR >= 0.3333) && (MeasureR < 0.3996)
IfTrueAction6=[!SetOption MeterR ImageName "5.png"][!UpdateMeter *][!Redraw]
IfCondition7=(MeasureR >= 0.3996) && (MeasureR < 0.4662)
IfTrueAction7=[!SetOption MeterR ImageName "6.png"][!UpdateMeter *][!Redraw]
IfCondition8=(MeasureR >= 0.4662) && (MeasureR < 0.5328)
IfTrueAction8=[!SetOption MeterR ImageName "7.png"][!UpdateMeter *][!Redraw]
IfCondition9=(MeasureR >= 0.5328) && (MeasureR < 0.5994)
IfTrueAction9=[!SetOption MeterR ImageName "8.png"][!UpdateMeter *][!Redraw]
IfCondition10=(MeasureR >= 0.5994) && (MeasureR < 0.6666)
IfTrueAction10=[!SetOption MeterR ImageName "9.png"][!UpdateMeter *][!Redraw]
IfCondition11=(MeasureR >= 0.6666) && (MeasureR < 0.7326)
IfTrueAction11=[!SetOption MeterR ImageName "10.png"][!UpdateMeter *][!Redraw]
IfCondition12=(MeasureR >= 0.7326) && (MeasureR < 0.7992)
IfTrueAction12=[!SetOption MeterR ImageName "11.png"][!UpdateMeter *][!Redraw]
IfCondition13=(MeasureR >= 0.7992) && (MeasureR < 0.8658)
IfTrueAction13=[!SetOption MeterR ImageName "12.png"][!UpdateMeter *][!Redraw]
IfCondition14=(MeasureR >= 0.8658) && (MeasureR < 0.9324)
IfTrueAction14=[!SetOption MeterR ImageName "13.png"][!UpdateMeter *][!Redraw]
IfCondition15=(MeasureR >= 0.9324)
IfTrueAction15=[!SetOption MeterR ImageName "14.png"][!UpdateMeter *][!Redraw]

[MeterBack]
Meter=Image
W=52
H=77
SolidColor=47,47,47,255
UpdateDivider=-1
LeftMouseUpAction=[Play "#@#Sounds\AudioTest.wav"]

[MeterL]
Meter=Image
X=5
Y=5
ImagePath=#@#Images\
ImageName=0.png
UpdateDivider=-1

[MeterR]
Meter=Image
X=3R
Y=5
ImagePath=#@#Images\
ImageName=0.png
UpdateDivider=-1

[MeterLText]
Meter=String
X=12
Y=1R
FontFace=Trebuchet MS
FontSize=8
FontColor=200,200,200,255
AntiAlias=1
Text=L
UpdateDivider=-1

[MeterRText]
Meter=String
X=35
Y=0r
FontFace=Trebuchet MS
FontSize=8
FontColor=200,200,200,255
AntiAlias=1
Text=R
UpdateDivider=-1
SoundLevel_1.0.rmskin
test.gif
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22620
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SoundLevel

Post by jsmorley »

This can of course be simplified by using Bitmap meters instead of Image meters. BitMap will automatically do all the math that was required to create all those IfCondition statements.

Code: Select all

[Rainmeter]
Update=15
DynamicWindowSize=1
AccurateText=1

[Metadata]
Name=SoundLevel
Author=JSMorley
Version=August 16, 2014
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
Information=BitMap Demonstration of new AudioLevel Plugin from dgrace||Left click to test channels||Latest version of the plugin is available at:|http://rainmeter.net/forum/viewtopic.php?p=101823#p101823

[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Output
RMSAttack=100
RMSDecay=300
RMSGain=2.5
PeakAttack=15
PeakDecay=2700
PeakGain=1.0

[MeasureL]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS

[MeasureR]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=R
Type=RMS

[MeterBack]
Meter=Image
W=52
H=77
SolidColor=47,47,47,255
UpdateDivider=-1
LeftMouseUpAction=[Play "#@#Sounds\AudioTest.wav"]

[MeterL]
Meter=BitMap
MeasureName=MeasureL
X=5
Y=5
BitMapImage=#@#Images\LevelBitmap.png
BitMapFrames=15
BitmapZeroFrame=1

[MeterR]
Meter=BitMap
MeasureName=MeasureR
X=3R
Y=5
BitMapImage=#@#Images\LevelBitmap.png
BitMapFrames=15
BitmapZeroFrame=1

[MeterLText]
Meter=String
X=12
Y=1R
FontFace=Trebuchet MS
FontSize=8
FontColor=200,200,200,255
AntiAlias=1
Text=L
UpdateDivider=-1

[MeterRText]
Meter=String
X=35
Y=0r
FontFace=Trebuchet MS
FontSize=8
FontColor=200,200,200,255
AntiAlias=1
Text=R
UpdateDivider=-1
LevelBitmap.png
test.gif
SoundLevel_1.1.rmskin
Bonus Hint: Creating a bitmap image from multiple images

Get ImageMagick and install it:
http://www.imagemagick.org/script/binary-releases.php#windows

Name your equally sized images 00.png to XX.png, so they are numbered in the order you want them. Leading zeros matter with how ImageMagick sorts them as it builds the bitmap. File names are strings, not numbers. 9.png would sort after 10.png.

Run this from the cmd.exe command line in the folder with your images:

Code: Select all

convert +append *.png LevelBitmap.png
2014-08-16_124317.jpg
Edit: Updated to fix an error in the Bitmap meters.
You do not have the required permissions to view the files attached to this post.
User avatar
lysy1993lbn
Posts: 291
Joined: July 25th, 2011, 9:53 am
Location: Lublin, Poland

Re: SoundLevel

Post by lysy1993lbn »

Bitmap version has some bug..
Image
"Never argue with an idiot, he will drag you down to his level and beat you with experience."
my deviantART | Alternative Rainmeter tray icons
User avatar
jsmorley
Developer
Posts: 22620
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SoundLevel

Post by jsmorley »

lysy1993lbn wrote:Bitmap version has some bug..
Image
Huh, it "overruns" the bitmap when it when the amplitude actually hits "1" or 100%. I'll have to look at that.
2014-08-16_183818.jpg
Edit:

I see the issue...

Set BitmapZeroFrame=1 on the two Bitmap meters. The problem is that the measurement it is using is a percentage from 0-100%, with both 0% and 100% being possible values.

So 0-99% it is fine. However, when it actually hits 100% it has "run out" of frames. There are 100 percentage "points" from 0-99%, but 101 from 0-100%. BitmapZeroFrame tells it explicitly that the first frame includes "zero". Then any percentage from 0 through 100% is properly spread over all frames.

I corrected the .rmskin in the post above, and beefed up the manual entry for BitmapZeroFrame a bit.
You do not have the required permissions to view the files attached to this post.
User avatar
rm_lion
Posts: 93
Joined: December 27th, 2013, 4:04 pm
Location: Switzerland

Re: SoundLevel

Post by rm_lion »

In my opinion it is much easier with a BarMeter and an underlying ImageMeter.

Code: Select all

[MeasureAudioOut_RMS_L]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS

[MeterOutRMS_Bar_L_B]
Meter=Image
ImageName=#@#LevelBarB.png
X=4
Y=191

[MeterOutRMS_Bar_L]
Meter=Bar
MeasureName=MeasureAudioOut_RMS_L
BarImage=#@#LevelBar.png
BarOrientation=Vertical
Flip=0
X=180
Y=128
AntiAlias=1
Like that you dont have to create an Image for each Level.
You do not have the required permissions to view the files attached to this post.
User avatar
jsmorley
Developer
Posts: 22620
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SoundLevel

Post by jsmorley »

rm_lion wrote:In my opinion it is much easier with a BarMeter.

Code: Select all

[MeasureAudioOut_RMS_L]
Measure=Plugin
Plugin=AudioLevel
Parent=MeasureAudio
Channel=L
Type=RMS

[MeterOutRMS_Bar_L]
Meter=Bar
MeasureName=MeasureAudioOut_RMS_L
BarImage=#@#LevelBarL.png
BarOrientation=Vertical
Flip=0
X=180
Y=128
AntiAlias=1
Like that you dont have to create an Image for each Level.
Bar would work fine for what it is, but I wanted the effect of the distinctly lighting level indicators, and didn't want those rectangles that indicate the level being partially filled. The goal was that each of those little rectangles is an "led" that lights up. You don't light up the bottom half of a light bulb.

Images, whether Image meters or Bitmap meters, is really the only way to get that without just hideous amounts of math. Look carefully at how the image works in the animated .gif I posted.

I'm a big fan of a Bar meter using a BarImage with a gradient. Not the right tool for this job though. That's why we have a lot of different meter types...
User avatar
rm_lion
Posts: 93
Joined: December 27th, 2013, 4:04 pm
Location: Switzerland

Re: SoundLevel

Post by rm_lion »

Ok. I see what you mean. You are right my Version is not exactly the same like yours.
User avatar
jsmorley
Developer
Posts: 22620
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: SoundLevel

Post by jsmorley »

rm_lion wrote:Ok. I see what you mean. You are right my Version is not exactly the same like yours.
Yeah, to be clear, this is the effect I wanted:

Code: Select all

[Rainmeter]
Update=250
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!EnableMeasure MeasureNum]

[MeasureNum]
Measure=Calc
Formula=MeasureNum + 0.01
IfAboveValue=1.00
IfAboveAction=[!PauseMeasure MeasureNum]
Disabled=1

[MeterOne]
Meter=BitMap
MeasureName=MeasureNum
BitMapImage=#@#Images\LevelBitmap.png
BitMapFrames=15
BitmapZeroFrame=1
SolidColor=47,47,47,255
Padding=5,5,5,5

[MeterTwo]
Meter=String
MeasureName=MeasureNum
Y=5R
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
NumOfDecimals=2
AntiAlias=1
test.gif
While the difference is subtle, this wasn't what I was going for in this case:

Code: Select all

[Rainmeter]
Update=250
DynamicWindowSize=1
AccurateText=1
LeftMouseUpAction=[!EnableMeasure MeasureNum]

[MeasureNum]
Measure=Calc
Formula=MeasureNum + 0.01
IfAboveValue=1.00
IfAboveAction=[!PauseMeasure MeasureNum]
Disabled=1

[MeterBack]
Meter=Image
ImageName=#@#Images\BarEmpty.png
SolidColor=47,47,47,255
Padding=5,5,5,5

[MeterOne]
Meter=Bar
MeasureName=MeasureNum
X=5
Y=5
BarImage=#@#Images\BarFull.png
BarOrientation=Vertical

[MeterTwo]
Meter=String
MeasureName=MeasureNum
Y=10R
FontSize=12
FontColor=255,255,255,255
SolidColor=47,47,47,255
Padding=5,5,5,5
NumOfDecimals=2
AntiAlias=1
test2.gif
You do not have the required permissions to view the files attached to this post.
Bekarfel
Posts: 217
Joined: May 16th, 2012, 5:38 am

Re: SoundLevel

Post by Bekarfel »

I downloaded this skin back when it first came out and really liked it, it's simple, does what it says on the tin, and that is cool.


But I might be a little insane. I've made... changes, and it took me around a year to do it, and I'm posting it here for the funsies (also so I don't lose it in case my hard drivecrashes again. Remaking the LED array a second time was lots of tears and pain).

I had some big help from eclectic-tech trying to dial in the effect I want. I'm not sure I was able to accurately describe what I wanted, but I got there in the end!
Edit: Added real-time animated gif of skin, also cleaned up some unused experimental stuff.
SoundlevelBitmap.gif
Bigger Bouncier BoomBlevel_1.001.rmskin
You do not have the required permissions to view the files attached to this post.
Last edited by Bekarfel on January 26th, 2024, 3:53 pm, edited 2 times in total.
moshi wrote:there are many Rainmeter skins that aren't really useful, so let's add another one.
jsmorley wrote:I have good news and bad news.
First the bad news. [...] We would be happy to have this happen and would love to work with anyone who is feeling ambitious.
Now the good news.
I lied, there isn't any good news...
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5326
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: SoundLevel

Post by eclectic-tech »

Looking good :thumbup:
GIF 1-18-2024 3-12-01 PM.gif
You do not have the required permissions to view the files attached to this post.