It is currently February 25th, 2020, 8:13 am

Magic Bar or Shape with Alpha fade gradient [tricky idea]

Help with creating, editing & fixing problems with skins
User avatar
Mor3bane
Posts: 760
Joined: May 7th, 2016, 7:32 am

Magic Bar or Shape with Alpha fade gradient [tricky idea]

Post by Mor3bane »

Hello,
So, I am not sure what kind of modifications I will need to make to a visualiser (monstercat), to have this effect I am hoping will look really good.

monstercat uses bar meters. I understand them. Whast I do not understand is how to apply the alpha gradient.

My idea is not typical as the gradient would be toward the base of the skin rather than going up, but for this I doubt it matters.

So here is a typical monstercat bar meter:

Code: Select all

[MeterBar0]
Meter=BAR
Group=GroupBarColor
MeasureName=MeasureAudioSmoothed1
X=(7*0.75)R
Y=0
W=(10*0.75)
H=(1080*0.75)/3
BarOrientation=Vertical
I would ask for recommendations or if I should switch it to use shape (which would be really fun - honestly).

But again, the alpha fade is what i am struggling with.

thanks.
Last edited by Mor3bane on January 5th, 2020, 11:39 pm, edited 3 times in total.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself
User avatar
Jeff
Posts: 125
Joined: September 3rd, 2018, 11:18 am

Re: Magic Bar or Shape with Alpha fade gradient

Post by Jeff »

bar meter supports all image options, it says that on the manual, just use ImageAlpha
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3762
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Magic Bar or Shape with Alpha fade gradient

Post by eclectic-tech »

Mor3bane wrote:
January 4th, 2020, 12:26 am
Hello,
So, I am not sure what kind of modifications I will need to make to a visualiser (monstercat), to have this effect I am hoping will look really good.

monstercat uses bar meters. I understand them. Whast I do not understand is how to apply the alpha gradient.

My idea is not typical as the gradient would be toward the base of the skin rather than going up, but for this I doubt it matters.

So here is a typical monstercat bar meter:

Code: Select all

[MeterBar0]
Meter=BAR
Group=GroupBarColor
MeasureName=MeasureAudioSmoothed1
X=(7*0.75)R
Y=0
W=(10*0.75)
H=(1080*0.75)/3
BarOrientation=Vertical
I would ask for recommendations or if I should switch it to use shape (which would be really fun - honestly).

But again, the alpha fade is what i am struggling with.

thanks.
This visualizer uses a script to write the code you posted for the bar meters, and it uses a solid color for the bars. It rewrites that file whenever you modify the visualizer, so in order to change the alpha value you need to make the change in the [ScriptFactoryBars] section. To add an alpha value, edit the "visualizer.ini, and in that section, add an alpha value to the line: Value1=#*Color*#,170

This will set the alpha of all bars when the script runs.

I would need to more information about how you want to style the bars, to suggest any other changes.

visualizer.ini

Code: Select all

...
[ScriptFactoryBars]
Measure=Script
ScriptFile=#@#scripts\Factory.lua
IncFile=#@#include\MeterBars.inc
Number=#BarCount#
SectionName=MeterBar%%
Option0=Meter
Value0=BAR
Option1=BarColor
Value1=#*Color*#,170
Option2=Group
Value2=GroupBars
Option3=MeasureName
Value3=MeasureAudioSmoothed{%%}
Option4=TransformationMatrix
Value4=[*Matrix*]
UpdateDivider=-1
...
EDIT: I have version 2.1.0 of the monstercat-visualizer, so your code may be slightly different, but as far as I know, the skin has always used the "Factory" scripts to write meters.
User avatar
Mor3bane
Posts: 760
Joined: May 7th, 2016, 7:32 am

Re: Magic Bar or Shape with Alpha fade gradient

Post by Mor3bane »

Thanks eclectic-tech
I understand the basic alpha option, however, I did mention that i was trying for a gradient. i did not mention that it would fade from 100% at the bar max to some other and estimably less than 50% transparency near or at the zero level - aesthetics would vary once i had something I could play with.

There is a new version that uses a couple lua scripts. The old 'factory" ini/inc are not there anymore. https://visualskins.com/media/p/282/monstercat-visualizer.rmskin


Cheers.
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3762
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Magic Bar or Shape with Alpha fade gradient

Post by eclectic-tech »

Mor3bane wrote:
January 4th, 2020, 7:10 am
Thanks eclectic-tech
I understand the basic alpha option, however, I did mention that i was trying for a gradient. i did not mention that it would fade from 100% at the bar max to some other and estimably less than 50% transparency near or at the zero level - aesthetics would vary once i had something I could play with.

There is a new version that uses a couple lua scripts. The old 'factory" ini/inc are not there anymore. https://visualskins.com/media/p/282/monstercat-visualizer.rmskin


Cheers.
Well... I installed the version you posted, but I think version 2.0.1 {from Visualskins) is older than my version 2.1.0.

Note: The download link on marcopixel's Deviantart page seems to be hacked (Marcopixel removed the link) :x
The Visual Skins version is out of date.
To get the latest version (2.1.0), download from marcopixel's Github Page.

-=-
In any case, they are almost identical, and both use Lua 'Factory' scripts to generate the meters; so to add an alpha value my previous post will do that.

The bar meter does not support gradient colors, so to do what you want, using Monstercat, is going to require changing the lua factory script measure, the one that generates the meters, to generate shape meters instead.

I am not sure what effect that may have on interactions with other features of the skin, but you could try changing that section and see what happens. :D

EDIT: Corrected link to latest download for monstercat, and struck-out corrected info...
User avatar
Mor3bane
Posts: 760
Joined: May 7th, 2016, 7:32 am

Re: Magic Bar or Shape with Alpha fade gradient

Post by Mor3bane »

I cannot make heads or tails of the lua.

On GitHub there are way more files than are in the rmskin.

I simply have no idea. So if eclectic-tech does, I'm game to try some recommendations.


I'll DL it again to be sure in the interim.

EDIT: Ok my version was my own per-version of an older monstercat. The link I posted - I googled it and copied the hyperlink.
Sew, I'ma gonna take a looksee. I feel strongly that something will make loads more sense now.

Aisle bee bach (or perhaps a guitarist that never got famous but wrote some really cool tunes)(true story).
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3762
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Magic Bar or Shape with Alpha fade gradient [discarded idea]

Post by eclectic-tech »

I didn't abandon this thread, just have been busy... :D

Give me some time to play with this and I may be able to suggest some options.
All that is needed is to change the keyword values in the script measure to write a Shape meter with a gradient, instead of a Bar meter. :)
User avatar
Mor3bane
Posts: 760
Joined: May 7th, 2016, 7:32 am

Re: Magic Bar or Shape with Alpha fade gradient [tricky idea]

Post by Mor3bane »

Thanks eclectic-tech.

I always appreciate your encouragement, advice, and input. :great:
My DevArt Gallery

There are many ways to be different - there is only one way to be yourself
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3762
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Magic Bar or Shape with Alpha fade gradient [tricky idea]

Post by eclectic-tech »

Here is an alternate visualizer.ini that uses Shape meters instead of Bar meters; one caveat I have not tried to emulate is TransformationMatrix, since the script was "fighting' me when trying to write that value. The only changes are to the [ScriptFactoryBars] and [ScriptFactoryShadowBars] sections.
monsterfade.gif
{Click image to animate...}

I would rename the original "Skins\Monstercat=Visualizer\visualizer.ini". Then create a new "visualizer.ini" file using this code, and save it in "Skins\Monstercat-Visualizer" folder.

Refresh All. And open the new "visualizer.ini"...

Code: Select all

[Rainmeter]
Group=MonstercatVisualizer | Spectrum
Update=10
BackgroundMode=2
SolidColor=0,0,0,1

; = IMPORTANT =
; = For configuring the rainmeter skin, right-click the visualizer and click on "Open settings".
; = You can also open the variables.ini file located in:
; = "My Documents\Rainmeter\Skins\Monstercat Visualizer\@Resources"

; Small context menu when you right-click the skin
ContextTitle=" Open settings"
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "general.ini"]
ContextTitle2=" Open variables file"
ContextAction2=["#@#variables.ini"]
ContextTitle3=" Toggle background"
ContextAction3=[!ToggleConfig "#ROOTCONFIG#\Background" "Background.ini"]

OnRefreshAction=[!WriteKeyValue Variables Config "#CURRENTCONFIG#" "#@#Variables.ini"][!ActivateConfig "#ROOTCONFIG#\Settings\misc\init" "InitializeSkin.ini"][!DisableMeasure "MeasureTrack"][!DisableMeasure "MeasureArtist"][!DisableMeasure "MeasurePosition"][!DisableMeasure "MeasureDuration"]

[Metadata]
Name=Monstercat Visualizer for Rainmeter
Author=marcopixel
Version=2.1.0
License=MIT License
Information=An realtime audio visualizer for Rainmeter similar to the ones used in the Monstercat videos.

[Variables]
; Include main variables file
@include=#@#variables.ini

; Include styling & media player measures
@include2=#@#include\MeasureMedia#MPMode#.inc
@include3=#@#include\MeasureStyling.inc

; Measure AudioDevice - gets the name of the current device
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
OnChangeAction=[!SetOption MeasureAudioDevice DynamicVariables 0][!UpdateMeasure MeasureAudioDevice]
UpdateDivider=1000
[MeasureAudioDevice]
Measure=String
String=[MeasureWin7Audio]
OnChangeAction=[!UpdateMeasure MeasureAudio][!RefreshGroup "Spectrum"]
UpdateDivider=1000

; Measure InvertVisualizer - changes the values to invert the audio spectrum
[MeasureInvertVisualizer]
Measure=Calc
Formula=#InvertVisualizer#
IfEqualValue=1
IfEqualAction=[!SetOption ScriptFactoryBars Value3 "MeasureAudioSmoothed{#BarCount# - %% - 1}"][!SetOption ScriptFactoryShadowBars Value3 "MeasureAudioSmoothed{#BarCount# - %% - 1}"][!UpdateMeasure "ScriptFactoryBars"][!CommandMeasure "ScriptFactoryBars" "Initialize()"][!UpdateMeasure "ScriptFactoryShadowBars"][!CommandMeasure "ScriptFactoryShadowBars" "Initialize()"]
IfBelowValue=1
IfBelowAction=[!SetOption ScriptFactoryBars Value3 "MeasureAudioSmoothed{%%}"][!SetOption ScriptFactoryShadowBars Value3 "MeasureAudioSmoothed{%%}"][!UpdateMeasure "ScriptFactoryBars"][!UpdateMeasure "ScriptFactoryShadowBars"][!CommandMeasure "ScriptFactoryBars" "Initialize()"][!CommandMeasure "ScriptFactoryShadowBars" "Initialize()"]
UpdateDivider=-1

; Measure AudioLevel - captures audio stream from windows and outputs fft
[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Output
FFTSize=#FFTSize#
FFTOverlap=(#FFTSize#/2)
FFTAttack=#FFTAttack#
FFTDecay=#FFTDecay#
Bands=#BarCount#
FreqMin=#FreqMin#
FreqMax=#FreqMax#
Sensitivity=#Sensitivity#
ID=#AudioDeviceID#
PeakAttack=0
PeakDecay=0
PeakGain=#PeakGain#

; Script Factory - generates the bars for the visualizer
[ScriptFactoryBars]
Measure=Script
ScriptFile=#@#scripts\Factory.lua
IncFile=#@#include\MeterBars.inc
Number=#BarCount#
SectionName=MeterBar%%
Option0=Meter
Value0=Shape
Option1=Shape
Value1='Rectangle 0,#BarHeight#,#BarWidth#,((-#BarHeight#) * [*MeasureAudioSmoothed{%%}:*]) | StrokeWidth 0 | Fill LinearGradient MyGradient#CRLF#MyGradient=90 | #*Color*#,1 ; 0.0 | #*Color*#,255 ; 1.0#CRLF#DynamicVariables=1'
Option2=Group
Value2=GroupBars
UpdateDivider=-1
[ScriptFactoryShadowBars]
Measure=Script
ScriptFile=#@#scripts\Factory.lua
IncFile=#@#include\MeterShadowBars.inc
Number=#BarCount#
SectionName=MeterShadowBar%%
Option0=Meter
Value0=BAR
Option1=BarColor
Value1=#*DropShadowColor*#
Option2=Group
Value2=GroupBars | GroupShadowBars
Option3=MeasureName
Value3=MeasureAudioSmoothed{%%}
Option4=TransformationMatrix
Value4=[*Matrix*]
Option5=Hidden
Value5=(#EnableDropShadow# > 0 ? 0 : 1)
UpdateDivider=-1

; Script Refresher - required for the factory script, refreshes the skin to apply
[ScriptRefresher]
Measure=Script
ScriptFile=#@#scripts\Refresher.lua
UpdateDivider=-1
Refreshed=0

; Include rotation measures
@include4=#@#include\MeasureRotate.inc

; Include bar meters
@include5=#@#include\MeterShadowBars.inc
@include6=#@#include\MeterBars.inc

; Include audio band measures
@include7=#@#include\MeasureBands.inc
@include8=#@#include\MeasureBandsSmoothed.inc

; Include progress bar
@include9=#@#include\MeterProgressBar.inc

; Include update checker
@include10=#@#include\MeasureUpdateChecker.inc
EDIT: I removed the changes I made to [ScriptFactoryShadowBars] and updated the code above to use the original code for shadow bars... sorry for the late change :oops:
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 3762
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Magic Bar or Shape with Alpha fade gradient [tricky idea]

Post by eclectic-tech »

I was able to get the script to write TransformationMatrix values correctly...

Use this "visualizer.ini" code to be able to use "Rotation" degrees in the setting skin.

Code: Select all

[Rainmeter]
Group=MonstercatVisualizer | Spectrum
Update=10
BackgroundMode=2
SolidColor=0,0,0,1

; = IMPORTANT =
; = For configuring the rainmeter skin, right-click the visualizer and click on "Open settings".
; = You can also open the variables.ini file located in:
; = "My Documents\Rainmeter\Skins\Monstercat Visualizer\@Resources"

; Small context menu when you right-click the skin
ContextTitle=" Open settings"
ContextAction=[!ActivateConfig "#ROOTCONFIG#\Settings" "general.ini"]
ContextTitle2=" Open variables file"
ContextAction2=["#@#variables.ini"]
ContextTitle3=" Toggle background"
ContextAction3=[!ToggleConfig "#ROOTCONFIG#\Background" "Background.ini"]

OnRefreshAction=[!WriteKeyValue Variables Config "#CURRENTCONFIG#" "#@#Variables.ini"][!ActivateConfig "#ROOTCONFIG#\Settings\misc\init" "InitializeSkin.ini"][!DisableMeasure "MeasureTrack"][!DisableMeasure "MeasureArtist"][!DisableMeasure "MeasurePosition"][!DisableMeasure "MeasureDuration"]

[Metadata]
Name=Monstercat Visualizer for Rainmeter
Author=marcopixel
Version=2.1.0
License=MIT License
Information=An realtime audio visualizer for Rainmeter similar to the ones used in the Monstercat videos.

[Variables]
; Include main variables file
@include=#@#variables.ini

; Include styling & media player measures
@include2=#@#include\MeasureMedia#MPMode#.inc
@include3=#@#include\MeasureStyling.inc

; Measure AudioDevice - gets the name of the current device
[MeasureWin7Audio]
Measure=Plugin
Plugin=Win7AudioPlugin
OnChangeAction=[!SetOption MeasureAudioDevice DynamicVariables 0][!UpdateMeasure MeasureAudioDevice]
UpdateDivider=1000
[MeasureAudioDevice]
Measure=String
String=[MeasureWin7Audio]
OnChangeAction=[!UpdateMeasure MeasureAudio][!RefreshGroup "Spectrum"]
UpdateDivider=1000

; Measure InvertVisualizer - changes the values to invert the audio spectrum
[MeasureInvertVisualizer]
Measure=Calc
Formula=#InvertVisualizer#
IfEqualValue=1
IfEqualAction=[!SetOption ScriptFactoryBars Value3 "MeasureAudioSmoothed{#BarCount# - %% - 1}"][!SetOption ScriptFactoryShadowBars Value3 "MeasureAudioSmoothed{#BarCount# - %% - 1}"][!UpdateMeasure "ScriptFactoryBars"][!CommandMeasure "ScriptFactoryBars" "Initialize()"][!UpdateMeasure "ScriptFactoryShadowBars"][!CommandMeasure "ScriptFactoryShadowBars" "Initialize()"]
IfBelowValue=1
IfBelowAction=[!SetOption ScriptFactoryBars Value3 "MeasureAudioSmoothed{%%}"][!SetOption ScriptFactoryShadowBars Value3 "MeasureAudioSmoothed{%%}"][!UpdateMeasure "ScriptFactoryBars"][!UpdateMeasure "ScriptFactoryShadowBars"][!CommandMeasure "ScriptFactoryBars" "Initialize()"][!CommandMeasure "ScriptFactoryShadowBars" "Initialize()"]
UpdateDivider=-1

; Measure AudioLevel - captures audio stream from windows and outputs fft
[MeasureAudio]
Measure=Plugin
Plugin=AudioLevel
Port=Output
FFTSize=#FFTSize#
FFTOverlap=(#FFTSize#/2)
FFTAttack=#FFTAttack#
FFTDecay=#FFTDecay#
Bands=#BarCount#
FreqMin=#FreqMin#
FreqMax=#FreqMax#
Sensitivity=#Sensitivity#
ID=#AudioDeviceID#
PeakAttack=0
PeakDecay=0
PeakGain=#PeakGain#

; Script Factory - generates the bars for the visualizer
[ScriptFactoryBars]
Measure=Script
ScriptFile=#@#scripts\Factory.lua
IncFile=#@#include\MeterBars.inc
Number=#BarCount#
SectionName=MeterBar%%
Option0=Meter
Value0=Shape
Option1=Shape
Value1='Rectangle 0,#BarHeight#,#BarWidth#,((-#BarHeight#) * [*MeasureAudioSmoothed{%%}:*]) | StrokeWidth 0 | Fill LinearGradient MyGradient#CRLF#MyGradient=90 | #*Color*#,1 ; 0.0 | #*Color*#,255 ; 1.0#CRLF#DynamicVariables=1#CRLF#TransformationMatrix=[*Matrix*]'
Option2=Group
Value2=GroupBars
UpdateDivider=-1
[ScriptFactoryShadowBars]
Measure=Script
ScriptFile=#@#scripts\Factory.lua
IncFile=#@#include\MeterShadowBars.inc
Number=#BarCount#
SectionName=MeterShadowBar%%
Option0=Meter
Value0=BAR
Option1=BarColor
Value1=#*DropShadowColor*#
Option2=Group
Value2=GroupBars | GroupShadowBars
Option3=MeasureName
Value3=MeasureAudioSmoothed{%%}
Option4=TransformationMatrix
Value4=[*Matrix*]
Option5=Hidden
Value5=(#EnableDropShadow# > 0 ? 0 : 1)
; Option0=Meter
; Value0=Shape
; Option1=Shape
; Value1='Rectangle (#BarWidth#-2),(#BarHeight#+2),2,((-#BarHeight#) * [*MeasureAudioSmoothed{%%}:*]) | StrokeWidth 0 | Fill LinearGradient MyGradient#CRLF#MyGradient=90 | #*DropShadowColor*#,1 ; 0.0 | #*DropShadowColor*#,255 ; 1.0#CRLF#DynamicVariables=1'
; Option2=Group
; Value2=GroupBars | GroupShadowBars
; Option3=Hidden
; Value3=(#EnableDropShadow# > 0 ? 0 : 1)
UpdateDivider=-1

; Script Refresher - required for the factory script, refreshes the skin to apply
[ScriptRefresher]
Measure=Script
ScriptFile=#@#scripts\Refresher.lua
UpdateDivider=-1
Refreshed=0

; Include rotation measures
@include4=#@#include\MeasureRotate.inc

; Include bar meters
@include5=#@#include\MeterShadowBars.inc
@include6=#@#include\MeterBars.inc

; Include audio band measures
@include7=#@#include\MeasureBands.inc
@include8=#@#include\MeasureBandsSmoothed.inc

; Include progress bar
@include9=#@#include\MeterProgressBar.inc

; Include update checker
@include10=#@#include\MeasureUpdateChecker.inc