It is currently November 25th, 2020, 2:01 pm

Is there lua code for getting lyrics to scroll in a media player skin?

Help with creating, editing & fixing problems with skins
User avatar
Thinkr8
Posts: 4
Joined: November 14th, 2020, 2:36 pm

Is there lua code for getting lyrics to scroll in a media player skin?

Post by Thinkr8 »

I'm building a media player skin and would like for it to scroll the lyrics to the current track playing, Is there Lua code for getting lyrics to scroll in a media player skin, and since I'm asking, is there any Lua code to get the number of tracks in said music folder?

And if I may point out, I believe this question would be best answered by JSMorley.

Thank you.
You do not have the required permissions to view the files attached to this post.
Someone said, "Your thinking too much, so I thought more."
User avatar
jsmorley
Developer
Posts: 21544
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Is there lua code for getting lyrics to scroll in a media player skin?

Post by jsmorley »

I don't think Lua is particularly needed for this:

Code: Select all

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

[Variables]
Scroll=10

[MeasureText]
Measure=WebParser
URL=file://#@#Text\Charge of the Light Brigade.txt
RegExp=(?siU)^(.*)$
StringIndex=1

[MeterContainerVisible]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,247,502 | Fill Color 47,47,47,255 | StrokeWidth 2 | Stroke Color 255,255,255,255

[MeterContainer]
Meter=Shape
X=1
Y=1
Shape=Rectangle 0,0,247,502 | StrokeWidth 2

[MeterText]
Meter=String
MeasureName=MeasureText
X=11
Y=(#Scroll#)
FontSize=11
FontWeight=400
FontColor=255,255,255,255
SolidColor=0,0,0,1
AntiAlias=1
DynamicVariables=1
InlineSetting=Weight | 700
InlinePattern=The Charge of the Light Brigade
InlineSetting2=Oblique
InlinePattern2=by Alfred, Lord Tennyson
MouseScrollDownAction=[!SetVariable Scroll "(Clamp(#Scroll#-10,-580,11))"][!UpdateMeter *][!Redraw]
MouseScrollUpAction=[!SetVariable Scroll "(Clamp(#Scroll#+10,-580,11))"][!UpdateMeter *][!Redraw]
LeftMouseUpAction=[!Log "Clicked String!"]
Container=MeterContainer

test1.gif


If your question is really about having the lyrics scroll in synchronization with the music, I have no idea how I would attack that. To be honest, I wouldn't try. You are going to have to scroll the lyrics based on the percentage complete the playback is, and I just don't see that being practical. A lot of songs have long sections of instruments only, and I can't see how you would ever end up with anything that wasn't just a mess that only sorta worked.
You do not have the required permissions to view the files attached to this post.
User avatar
Thinkr8
Posts: 4
Joined: November 14th, 2020, 2:36 pm

Re: Is there lua code for getting lyrics to scroll in a media player skin?

Post by Thinkr8 »

That's great news, thank you, Mr. Morley, perhaps when I have more time I'll look into having realtime scrolling.

Loving Rainmeter for well over 15 years now. Your expert advice is noted. :welcome: :thumbup:

I thought I was smart enough to configure the skin you gave me for my project, but I'm stuck with "URL=file://#@#Text\Charge of the Light Brigade.txt"
I knew I wouldn't have that txt file so I made changes to get my test.txt to show in the container (see attachment image) and I can't. Sorry, I'm getting old in years! What do I do? TY.
You do not have the required permissions to view the files attached to this post.
Someone said, "Your thinking too much, so I thought more."
User avatar
CyberTheWorm
Posts: 736
Joined: August 22nd, 2016, 11:32 pm
Location: Surrey, B.C., Canada

Re: Is there lua code for getting lyrics to scroll in a media player skin?

Post by CyberTheWorm »

I created one basied on jsmorley's info, it was just a first attempt. Sometime it does not get lyrics.
MediaPlayerWithLyrics_1.0.0.rmskin
You do not have the required permissions to view the files attached to this post.
The only source of knowledge is experience. Albert Einstein
Deviant Art Page
User avatar
Thinkr8
Posts: 4
Joined: November 14th, 2020, 2:36 pm

Re: Is there lua code for getting lyrics to scroll in a media player skin?

Post by Thinkr8 »

Thanks, I'll look into it. :thumbup:

I have figured it out for the most part! @CyberTheWorm, I ended up using your skin code and will be giving you the credit, thank you.
Someone said, "Your thinking too much, so I thought more."