It is currently April 20th, 2024, 6:42 am

Best way to add automatic left to right scrolling text to this.

Get help with creating, editing & fixing problems with skins
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Best way to add automatic left to right scrolling text to this.

Post by SilverDarkBlade »

Trying to add scrolling text to this specific portion of this skin. was looking at different ways to do it and they didn't seem compatible with the way this skin works.

anyway here is the code

Code: Select all

[Rainmeter]
Group=SongInfo
Update=100
SkinWidth=#Width#

; = IMPORTANT =
; = For configuring the rainmeter skin, right-click the visualizer and click on "Open variables".
; = 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=" Toggle background"
ContextAction2=[!ToggleConfig "#ROOTCONFIG#\Background" "Background.ini"]

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

[Variables]
Width=850
; Includes the variables/styles used for the skin.
@include=#@#variables.ini
; Include MeasureGenre and Chameleon for dynamic colors.
@include2=#@#include\Measure#MPMode#.inc
@include3=#@#include\MeasureStyling.inc

; Meter - artist and track

[MeterArtist]
Meter=String
MeasureName=MeasureArtist
X=(#BarGap#*#ScaleVisualizer#)
Y=(30*#ScaleSongInformation#)
H=(100*#ScaleSongInformation#)
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#
FontFace=#Font1#
FontSize=(#FontSize1#*#ScaleSongInformation#)
StringCase=Upper
AntiAlias=1
ClipString=2
Text="%1"
Group=SongMeta
[MeterTrack]
Meter=STRING
MeasureName=MeasureTrack
X=(8*#ScaleSongInformation#)r
Y=0R
H=(100*#ScaleSongInformation#)
W=(#BarWidth#+#BarGap#)*(#BarCount#-12)*#ScaleVisualizer#-(8*#ScaleSongInformation#)
FontFace=#Font2#
FontSize=(#FontSize2#*#ScaleSongInformation#)
StringCase=Upper
AntiAlias=1
ClipString=2
Text="%1"
Group=SongMeta
also if its possible to only make it scroll on mouseover that would be great.
Last edited by SilverDarkBlade on March 8th, 2017, 3:21 pm, edited 2 times in total.
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Best way to add scrolling text to this.

Post by balala »

The posted code is practically useless, because it has three (or maybe even more) unknown included files: @Resources\variables.ini, @Resources\include\Measure#MPMode#.inc and @Resources\include\MeasureStyling.inc (because the name of the second file contains a variable, there could be even more then three). These files (probably the first one) probably have a lot of needed but unknown variables, so we can't check deeply the posted code).
However, here is a way to can scroll a string:

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
BackgroundMode=2
SolidColor=80,80,80,160
SkinWidth=160
SkinHeight=200
BevelType=1

[Variables]
Y=0
Speed=5
Text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nisi nisl, dapibus ut mauris et, blandit ultrices augue. Proin ut quam ut ante mollis facilisis. Fusce sit amet semper est. Morbi malesuada pellentesque odio non finibus. Proin congue vestibulum metus, accumsan euismod mauris faucibus in. Vivamus nec eleifend lacus. Nam egestas libero at turpis imperdiet eleifend. Etiam dolor nisl, ornare vestibulum dolor eu, condimentum ultrices ex. Morbi auctor commodo magna et vehicula. Aliquam non dignissim erat. Cras vel pretium mi, quis porta ipsum. Duis commodo elit est, non eleifend libero facilisis sit amet. Donec posuere metus at ipsum aliquet vulputate. Quisque eu viverra ante, eu porttitor turpis. Nunc odio purus, vulputate nec accumsan non, ornare nec ligula. Praesent ipsum magna, viverra ac sem sit amet, fringilla condimentum mi.

[MeterScroll]
Meter=STRING
X=0
Y=#Y#
W=150
H=1200
Padding=5,5,5,5
ClipString=1
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontSize=9
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#Text#
MouseScrollDownAction=[!SetVariable Y "(Clamp((#Y#-#Speed#),-410,0))"][!UpdateMeter "MeterScroll"][!Redraw]
MouseScrollUpAction=[!SetVariable Y "(Clamp((#Y#+#Speed#),-410,0))"][!UpdateMeter "MeterScroll"][!Redraw]
DynamicVariables=1
If you want to use this code, be careful to the followings:
  • The Update of this code is set to -1. You had Update=100 on your skin, probably -1 won't be good for your purposes. I didn't want to use Update=100, because for the needs of the above code, that's to little.
  • You'll have to adjust the value of -410, used into the Clamp functions of the MouseScrollDownAction and MouseScrollUpAction options of the [MeterScroll] meter, depending on the length of the text, the size of the used font and so on.
  • The Speed variable controls the scrolling speed.
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Best way to add scrolling text to this.

Post by SilverDarkBlade »

balala wrote:The posted code is practically useless, because it has three (or maybe even more) unknown included files: @Resources\variables.ini, @Resources\include\Measure#MPMode#.inc and @Resources\include\MeasureStyling.inc (because the name of the second file contains a variable, there could be even more then three). These files (probably the first one) probably have a lot of needed but unknown variables, so we can't check deeply the posted code).
However, here is a way to can scroll a string:

Code: Select all

[Rainmeter]
Update=-1
AccurateText=1
BackgroundMode=2
SolidColor=80,80,80,160
SkinWidth=160
SkinHeight=200
BevelType=1

[Variables]
Y=0
Speed=5
Text=Lorem ipsum dolor sit amet, consectetur adipiscing elit. Suspendisse nisi nisl, dapibus ut mauris et, blandit ultrices augue. Proin ut quam ut ante mollis facilisis. Fusce sit amet semper est. Morbi malesuada pellentesque odio non finibus. Proin congue vestibulum metus, accumsan euismod mauris faucibus in. Vivamus nec eleifend lacus. Nam egestas libero at turpis imperdiet eleifend. Etiam dolor nisl, ornare vestibulum dolor eu, condimentum ultrices ex. Morbi auctor commodo magna et vehicula. Aliquam non dignissim erat. Cras vel pretium mi, quis porta ipsum. Duis commodo elit est, non eleifend libero facilisis sit amet. Donec posuere metus at ipsum aliquet vulputate. Quisque eu viverra ante, eu porttitor turpis. Nunc odio purus, vulputate nec accumsan non, ornare nec ligula. Praesent ipsum magna, viverra ac sem sit amet, fringilla condimentum mi.

[MeterScroll]
Meter=STRING
X=0
Y=#Y#
W=150
H=1200
Padding=5,5,5,5
ClipString=1
FontColor=220,220,220
FontEffectColor=0,0,0
SolidColor=0,0,0,1
StringEffect=Shadow
FontSize=9
FontFace=Segoe UI
StringStyle=BOLD
StringAlign=LEFT
AntiAlias=1
Text=#Text#
MouseScrollDownAction=[!SetVariable Y "(Clamp((#Y#-#Speed#),-410,0))"][!UpdateMeter "MeterScroll"][!Redraw]
MouseScrollUpAction=[!SetVariable Y "(Clamp((#Y#+#Speed#),-410,0))"][!UpdateMeter "MeterScroll"][!Redraw]
DynamicVariables=1
If you want to use this code, be careful to the followings:
  • The Update of this code is set to -1. You had Update=100 on your skin, probably -1 won't be good for your purposes. I didn't want to use Update=100, because for the needs of the above code, that's to little.
  • You'll have to adjust the value of -410, used into the Clamp functions of the MouseScrollDownAction and MouseScrollUpAction options of the [MeterScroll] meter, depending on the length of the text, the size of the used font and so on.
  • The Speed variable controls the scrolling speed.
i assume this is referencing a scrollbar type thing? i was referring to automatic scrolling text actually lol.

and the text in specific i need to scroll is the "%1" things. sorry i'm quite new to rainmeter.

in short this code fetches the name of a song and artist from spotify. those names and artists are what i want to scroll (on their own not using mouse wheel)

if other code is needed i can provide it but i didn't think it was relevant for this specific thing im requesting help with
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Best way to add scrolling text to this.

Post by balala »

SilverDarkBlade wrote:i assume this is referencing a scrollbar type thing? i was referring to automatic scrolling text actually lol.

and the text in specific i need to scroll is the "%1" things. sorry im quite new to rainmeter.

in short this code fetches the name of a song and artist from spotify. those names and arests are what i wnat to scroll (on their own not using mouse wheel)
And I'm sorry too, I think I misunderstood you.
Probably that's possible as well, but as I described above, I can't check or use your code. Please post the needed included files.
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Best way to add scrolling text to this.

Post by SilverDarkBlade »

balala wrote:And I'm sorry too, I think I misunderstood you.
Probably that's possible as well, but as I described above, I can't check or use your code. Please post the needed included files.
here is the variables ini

Code: Select all

[Variables]
Version=1.5.3
;==========================
; General settings
;==========================

PlayerName=Spotify
; Change this variable to your media player.
; Visit this page for all supported players: http://docs.rainmeter.net/manual/plugins/nowplaying#playerlist

ScaleVisualizer=0.8
; Changes the size of the visualizer
; Can be anything between 0.1 (really small) to 1.0 (fullscreen).
; Default: 0.8

ScaleSongInformation=0.8
; Changes the size of the song information skin.
; Can be anything between 0.1 (really small) to 1.0 (fullscreen).
; Default: 0.8

;==========================
; Spectrum settings
;==========================

FlipVisualizer=0
; This will flip the spectrum so that the bars go down instead of up.
; Default: 0

AverageSize=4
; Higher numbers = smoother visualization, but with delay
; Lower numbers = faster visualization, but less smooth
; This will increase/decrease performance and the quality of the visualization.
; Default: 4

BarWidth=22
; Width of the visualizer bars, don't go lower as 6 or the rounded edges will dissolve.
; Default: 18

BarHeight=350
; Height of the visualizers bars in Pixels. Also allowed are percentages based on the screen size.
; Default: 350

BarGap=6
; Margin between the different visualizer bars.
; Default: 7

BarCount=64
; Number of the visualizer bars, maximum 100.
; Default: 63

MinBarValue=0.005
; Bars shown at the bottom of the visualizer bars.
; Increasing the value will make the bars bigger, decreasing it smaller.
; Default: 0.005

Sensitivity=45
; A number specifying in what dB range the measure will return FFT and Band data. 
; Increasing this value will make the visualizer respond to quieter sounds and make the graph bigger, decreasing it will show louder sounds.
; Default: 45

FFTSize=4096
; A number value for the frequency resolution of the output data.
; Increasing this value will add more cpu load, so keep it for the best result on this value. If you got an slower pc change the value to 512 or 256.
; This will increase/decrease performance and the quality of the visualization.
; Best kept at default values.
; Default: 4096

FFTAttack=80
; Time in Milliseconds till the bars rise to the signal level.
; Higher values adds delay to the visualization, but makes it much smoother and calmer.
; Best kept at default values.
; Default: 80

FFTDecay=110
; Time in Milliseconds till the bars fall from the signal level.
; Higher values will keep the bars much longer visible, lower values makes it more "jumpy".
; Best kept at default values.
; Default: 110

FreqMin=20
; Minimum frequency detected by the visualizer.
; Default: 20

FreqMax=15000
; Maximum frequency detected by the visualizer.
; Default: 15000;

;==========================
; Style settings
;==========================

font1=Nexa Bold
font2=Nexa Light
; Fonts used for the title and artist.
; Font1 is for the Artist, Font2 for the Title
; Default: font1=Nexa Bold, font2=Nexa Light

FontSize1=72
FontSize2=40
; Font sizes for the title and artist.
; Font1 is for the Artist, Font2 for the Title
; Default: FontSize1=72, FontSize2=40

TextColor=#White#
; Color used for text.
; Default: #White#

Color=#EDM#
; Color of the visualizer bars/monstercat cover in RGB(a).
; This is the default color when genre-based colors are activated.
; You can change the color to one of the following genres (in the list) by writing the genre like this: #Dubstep#

; This is the color list for the genre-based colors in RGB(a).
EDM=193,193,193
Electro=230,206,0
House=234,140,6
DnB=242,25,4
Dubstep=141,4,225
Drumstep=243,33,136
GlitchHop=11,151,87
Trap=140,15,39
Trance=0,126,231
HardDance=1,151,0
NuDisco=28,171,179
FutureBass=154,152,252
White=255,255,255
Black=0,0,0

EnableDynamicColors=0
; Changing this value will enable/disable dynamic colors.
; There are three different settings you can choose.

; 0 - OFF, all dynamic color settings disabled.

; 1 - GENRE, color will change dynamically to the genre of the song.
;     This will work currently only on AIMP, CAD, iTunes, WMP and Winamp.
;     Also the song needs Genre ID3 tags.

; 2 - COVER, color will change dynamically to the cover art of your song.

; This will have an major impact on the performance of the visualizer and your CPU.
; Turn off if you experience lags or slowdowns.
; Default: 0

DisableDynamicFontColors=0
; Changing this value will enable/disable dynamic font colors.
; There are three different settings you can choose.
; Default: 1

ShowMonstercatCover=0
; Changing this value will replace the song cover with an full-color cover with the monstercat logo (like in the videos).
; Default: 0

NoArtistNameText=N/A
NoTrackNameText=N/A
; This will replace the replacement text when there's no track name/artist or if nothing is playing.
; Default: NoArtistNameText=N/A, NoTrackNameText=N/A

DisableAutoHide=1
; Changing this value will hide the Visualizer when not playing.
; Default: 1

HideProgressBar=0
; Changing this value will hide the progress bar below the visualizer.
; Default: 1

EnableVisualizer=1
; Changing this value will hide the progress bar below the visualizer.
; Default: 1

;=====================================================

; These variables are constants and are better untouched! Changing here will probably break something.
DefaultHeight=(#WORKAREAHEIGHT#/3)
BarCountCalc=(#BarCount#+1)
GenreColor=#Color#
MPMode=Spotify
SettingsHeight=510
Sensitivty=45
here is the relevant mpmmode inc file

Code: Select all

[Variables]
; Includes the variables/styles used for the skin.
@include=#@#variables.ini

[MeasureState]
Measure=Plugin
Plugin=NowPlaying
Playername=Spotify
PlayerType=State

[MeasureStateButton]
Measure=Plugin
Plugin=SpotifyPlugin
Type=Playing
Substitute="0":"Play","1":"Pause","2":"Play"

[MeasureTrack]
Measure=Plugin
Plugin=SpotifyPlugin
Type=TrackName
Substitute="":"#NoTrackNameText#"

[MeasureArtist]
Measure=Plugin
Plugin=SpotifyPlugin
Type=ArtistName
Substitute="":"#NoArtistNameText#"

[MeasureCover]
Measure=Plugin
Plugin=SpotifyPlugin
Type=AlbumArt
Res=640
DefaultPath=#@#images\nocover.png
CoverPath=#@#images\coverSpotify.png
Substitute="":"#@#images\nocover.png"
Paused=#ShowMonstercatCover#

[MeasurePosition]
Measure=Plugin
Plugin=SpotifyPlugin
Type=Position

[MeasureDuration]
Measure=Plugin
Plugin=SpotifyPlugin
Type=Length

[MeasureProgress]
Measure=Plugin
Plugin=SpotifyPlugin
Type=Progress
AverageSize=20

[MeasureAutoHideSpotify]
Measure=Plugin
Plugin=NowPlaying
PlayerName=Spotify
PlayerType=State
IfEqualValue=0
IfEqualAction=[!HideFade][!HideFade "#ROOTCONFIG#\Song Information"]
IfAboveValue=0
IfAboveAction=[!ShowFade][!ShowFade "#ROOTCONFIG#\Song Information"]
Disabled=#DisableAutoHide#
and here is measurestyling

Code: Select all

[MeasureSetMediaPlayer]
Measure=String
String=#PlayerName#
IfMatch=Spotify
IfMatchAction=[!WriteKeyValue Variables MPMode Spotify "#@#variables.ini"][!DisableMeasure MeasureGenre]
IfMatch2=GPMDP
IfMatchAction2=[!WriteKeyValue Variables MPMode GPMDP "#@#variables.ini"][!DisableMeasure MeasureGenre]
IfNotMatchAction=[!WriteKeyValue Variables MPMode NowPlaying "#@#variables.ini"][!EnableMeasure MeasureGenre]
UpdateDivider=-1

[MeasureSetDynamicColors]
Measure=Calc
Formula=#EnableDynamicColors#
IfBelowValue=1
IfBelowAction=[!SetOptionGroup GroupBarColor MeterStyle "StyleStaticBar"][!SetOption MeterCoverBG MeterStyle "StyleStaticMeter"][!SetOptionGroup SongMeta MeterStyle "StyleStaticText"]
IfEqualValue=1
IfEqualAction=[!SetOptionGroup GroupBarColor MeterStyle "StyleGenreBar"][!SetOption MeterCoverBG MeterStyle "StyleGenreMeter"][!SetOptionGroup SongMeta MeterStyle "StyleGenreText"]
IfAboveValue=1
IfAboveAction=[!SetOptionGroup GroupBarColor MeterStyle "StyleCoverBar"][!SetOption MeterCoverBG MeterStyle "StyleCoverMeter"][!SetOptionGroup SongMeta MeterStyle "StyleCoverText"]
UpdateDivider=-1

[MeasureDisableDynamicFontColors]
Measure=Calc
Formula=#DisableDynamicFontColors#
IfEqualValue=1
IfEqualAction=[!SetOptionGroup SongMeta MeterStyle "StyleStaticText"]
UpdateDivider=-1

[MeasureFlipProgressbar]
Measure=Calc
Formula=#FlipVisualizer#
IfEqualValue=1
IfEqualAction=[!SetOption MeterProgressBar Y 0]
UpdateDivider=-1

[MeasureGetCoverColor]
Measure=Plugin
Plugin=Chameleon
Type=File
Path=[MeasureCover]
UpdateDivider=10
[MeasureCoverColor]
Measure=Plugin
Plugin=Chameleon
Parent=MeasureGetCoverColor
Format=Dec
Color=Background1
Substitute="":"#Color#","0,0,0,255":"#Color#","254,254,254":"#Color#"
UpdateDivider=10

[MeasureGenre]
Measure=Plugin
Plugin=NowPlaying
PlayerName=#PlayerName#
PlayerType=Genre
; You can add your own genres here.
; Use | as dividier and replace spaces with \s (otherwise it won't work)
; Electro
IfMatch=Electro
IfMatchAction=[!SetVariable GenreColor "#Electro#"]
; Electronic/EDM
IfMatch2=EDM|Electronic|Breaks|Chillout|Bounce|Chill
IfMatchAction2=[!SetVariable GenreColor "#EDM#"]
; House/Progressive House
IfMatch3=House|Electro\sHouse|Progressive\sHouse
IfMatchAction3=[!SetVariable GenreColor "#House#"]
; Drum & Bass
IfMatch4=Drum\s&\sBass|DnB
IfMatchAction4=[!SetVariable GenreColor "#DnB#"]
; Dubstep
IfMatch5=Dubstep
IfMatchAction5=[!SetVariable GenreColor "#Dubstep#"]
; Drumstep
IfMatch6=Drumstep
IfMatchAction6=[!SetVariable GenreColor "#Drumstep#"]
; Glitch Hop
IfMatch7=Glitch\sHop|GlitchHop
IfMatchAction7=[!SetVariable GenreColor "#GlitchHop#"]
; Trap
IfMatch8=Trap
IfMatchAction8=[!SetVariable GenreColor "#Trap#"]
; Trance
IfMatch9=Trance|Deep\sHouse
IfMatchAction9=[!SetVariable GenreColor "#Trance#"]
; Hard Dance
IfMatch10=Hard\sDance
IfMatchAction10=[!SetVariable GenreColor "#HardDance#"]
; Nu Disco/Indie Dance
IfMatch11=Nu\sDisco|NuDisco|Disco|Indie\sDance|Electro\sSwing
IfMatchAction11=[!SetVariable GenreColor "#NuDisco#"]
; Future Bass
IfMatch12=Future|Future\sBass
IfMatchAction12=[!SetVariable GenreColor "#FutureBass#"]
; Here is an example for an custom genre. Colors need to be rgb(a) values.
IfMatch13=Mashup|Mash\sUp
IfMatchAction13=[!SetVariable GenreColor "192,255,99"]
Substitute="":"#Color#"
Disabled=1

[StyleStaticBar]
BarColor=#Color#
[StyleStaticMeter]
SolidColor=#Color#
[StyleStaticText]
FontColor=#TextColor#
[StyleGenreMeter]
SolidColor=#GenreColor#
DynamicVariables=1
[StyleGenreBar]
BarColor=#GenreColor#
DynamicVariables=1
[StyleGenreText]
FontColor=#GenreColor#
DynamicVariables=1
[StyleCoverMeter]
SolidColor=[MeasureCoverColor]
DynamicVariables=1
[StyleCoverBar]
BarColor=[MeasureCoverColor]
DynamicVariables=1
[StyleCoverText]
FontColor=[MeasureCoverColor]
DynamicVariables=1
there are a lot more files so i will add them as needed if needed
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Best way to add automatic left to right scrolling text to this.

Post by balala »

I'm not sure I can help here, because I'm not using Spotify, but have the impression that your code requires it. If that's right, someone else will have to help you.
And be careful with Spotify: https://forum.rainmeter.net/viewtopic.php?p=131041#p131041
User avatar
SilverDarkBlade
Posts: 29
Joined: March 7th, 2017, 7:18 am

Re: Best way to add automatic left to right scrolling text to this.

Post by SilverDarkBlade »

balala wrote:I'm not sure I can help here, because I'm not using Spotify, but have the impression that your code requires it. If that's right, someone else will have to help you.
And be careful with Spotify: https://forum.rainmeter.net/viewtopic.php?p=131041#p131041
i found some old text from 2014 that was your post actually that i am using to try to accomplish what i want.

and yea it appears that spotify problem was fixed in update 1.0.4

current version of spotify is 1.0.5 ^^
User avatar
balala
Rainmeter Sage
Posts: 16148
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Best way to add automatic left to right scrolling text to this.

Post by balala »

SilverDarkBlade wrote:i found some old text from 2014 that was your post actually that i am using to try to accomplish what i want.
Which one of them?
SilverDarkBlade wrote:and yea it appears that spotify problem was fixed in update 1.0.4

current version of spotify is 1.0.5 ^^
Ok, as I said, I'm not using Spotify. Just found those articles a while ago and posted them. If Spotify is fixed, that's a good point.