marcopixel / monstercat-visualizer

A real time audio visualizer for Rainmeter similar to the ones used in the Monstercat videos.
MIT License
920 stars 103 forks source link

Using album art/genre color in other skins #43

Closed TheMannager closed 7 years ago

TheMannager commented 7 years ago

Hello, I am trying to use this skin in conjunction with another. All I want to do is have the other skin pull the text color the song data. I got this working simply by including MeasureStyling.inc. This works except that it does not change when the song ends and the next one begins. I deduced that the refresher script may be related. I was wondering if you had an idea as to how to get my other skin to update its color when the visualizer and song data change color. Thanks

tjhrulz commented 7 years ago

Alright it has been a while since I touched that section of the skin so it may have changed but I will warn you it does not scale well. Basically the way rainmeter works once you set up a measure or meter it never checks if any variables have changed unless dynamic variables is turned on and then it check it on every run which is computationally expensive.

Your options are as follows:

  1. Turn on dynamic variables on whatever meter is using the styling (Worst performance)
  2. Add an OnChangeAction to the measure that set DynamicVariables=0 on the meters that you use (I would recommend using a group for them). How DynamicVariables=0 works is it essentially refetches the variables values. (Much better performance however each skin you use it in gets its own color generation)
  3. Have a master skin that sets the colors for the rest of the skins, this will be hard to write and in most cases you wont need this kind of performance.

I recommend option number 2, its performant and easy to write.

Edit: Looking at it some more I am not sure how you are having it not update as all the genres have DynamicVariables=1 by default, did you correctly set the style/group and could you post the code for this?

tjhrulz commented 7 years ago

Alright so I just got in touch with Marco. Right now I am working on some performance improvements and as a part of this I am going to rewrite the dynamic color system. This will make it easier for you to use them as all you will have to do is the the dynamic color variable as your color and add your meter to the updater group.

So if you wait a couple days what you wanna do will get easier to do.

TheMannager commented 7 years ago

OK awesome thanks. That is great. I look forward to seeing how it turns out.

Nathaniel

On Apr 18, 2017, at 2:48 PM, Trevor Hamilton notifications@github.com wrote:

Alright so I just got in touch with Marco. Right now I am working on some performance improvements and as a part of this I am going to rewrite the dynamic color system. This will make it easier for you to use them as all you will have to do is the the dynamic color variable as your color and add your meter to the updater group.

So if you wait a couple days what you wanna do will get easier to do.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/MarcoPixel/Monstercat-Visualizer/issues/43#issuecomment-294958934, or mute the thread https://github.com/notifications/unsubscribe-auth/ALQS3D8x9Kpq7mnQjuRKd1VUbwka2MkQks5rxRNwgaJpZM4M_vEC.

tjhrulz commented 7 years ago

All the code relating to the new color system has been implemented and can be found here: https://github.com/MarcoPixel/Monstercat-Visualizer/tree/Performance You will need to click clone or download then download zip on the right hand side. Once it is downloaded just extract the zip contents over your current monstercat setup (You should not need to delete anything just overwrite all files).

To take advantage of the new color is pretty simple. You will need to include the MeasureStyling.inc as before. Then whenever you want to use the color from MV you will need to either use the #color# or #textColor# variables. Text color can be the same as color if dynamic font colors is turned on in the settings.

Also if the meter you are using is does not have dynamic variables turned on you will want to add to its list of group GroupDynamicColors. This will ensure that you get the new song color on song change without wasting CPU the rest of the time. If you do have dynamicVariables=1 then do not add this as it will turn dynamic variables off.

So two quick examples

[MeterText]
Meter=String
X=0
Y=0
FontColor=#TextColor#
FontSize=12
AntiAlias=1
Text=This text uses the text color from Monstercat Visualizer!
Group=GroupDynamicColors

And one that uses the normal color

[MeterBackground]
Meter=Image
X=0
Y=0
W=200
H=200
SolidColor=#Color#
Group=GroupDynamicColors

Also I should note that these colors can not be use in the [Rainmeter] section as it does not support dynamic variables, so if you want to add a background to your whole skin you will have to use a background image instead.

Also remember in the same meter section do not use both Group=GroupDynamicColors and DynamicVariables=1, the group setting will override DynamicVariables=1. Just use one or the other.

tjhrulz commented 7 years ago

Since you have not responded that you needed further help I am gonna go on ahead and close this issue.

TheMannager commented 7 years ago

Ok thanks yeah stab helped a lot.