Resource icon

OBS Lua Lyrics Display 0.2

JStark

New Member
JStark submitted a new resource:

Lyrics Display - Displays and updates song lyrics (or other text) from lines in a text file.

This script is able to update a text (GDI+) source based on lines in a text file. It's designed to take lyrics from a text file and display them. It's configurable to display any number of lines from the text file at one time. Set hotkeys in settings to scroll through the lyrics.

Read more about this resource...
 

Kapoulas

New Member
Hello.

Thanks for this plug-in. Im trying to use it but I cannot select anything from the field "Text Source". It is empty even though I have at least one default Text GDI+ source in my scene.

Cheers!

Untitled.png
 

Kapoulas

New Member
And Yep.... I found it.

You have to write the Text Source by yourself. Not possible to be shown on the dropdown menu.
Thanks again..
 

marketing tv

New Member
Svp aidez moi jai installer obs malheureusement jai reçoit un message qui me dis cette version obs n'est pas compatibles avec mon mon Pc que dois je faire merci
 

JStark

New Member
Thanks for the feedback.

I'm new to OBS and Lua scripts, so I'm not totally sure what the problem is or how to figure that out. It works for me when I add a text source to my scene. Then the script settings will show a drop-down list of the text sources.

I based this on the countdown script included in OBS, and I didn't change that part of the code. So if it's not working, sorry, I'm not much help.
 

Mermaldad

New Member
This is my first foray into OBS Lua scripts, and since I am interested in doing something like what you have done here, I thought I'd take a look at your script. I noticed that on line 224, the first argument is "lyric_prev_hotkey_thing", but that argument was already used on line 222. Shouldn't it be "lyric_sb_hotkey_thing"? I haven't tried running it or anything, so I could be all wet.
 

amirchev

Member
Thanks for the feedback.

I'm new to OBS and Lua scripts, so I'm not totally sure what the problem is or how to figure that out. It works for me when I add a text source to my scene. Then the script settings will show a drop-down list of the text sources.

I based this on the countdown script included in OBS, and I didn't change that part of the code. So if it's not working, sorry, I'm not much help.
You can make it work by changing source_id = obs.obs_source_get_id(source) to source_id = obs.obs_source_get_unversioned_id(source)
 

amirchev

Member
JStark submitted a new resource:

Lyrics Display - Displays and updates song lyrics (or other text) from lines in a text file.



Read more about this resource...
JStark, I liked your code, since I was looking to write something similar. I edited to make a few changes.
Changes:
1) You can now either source the text from a file or paste it right into OBS
2) It will now advance multiple lines at a time, so if you're displaying two lines, it will advance by two lines each time
3) You can now select the text source from the drop-down

I've attached it inside a zip file, since I can't upload straight Lua files. Feel free to update this post using my edits. If you'd rather not, then I will make a new post.
 

Attachments

  • lyrics.zip
    1.7 KB · Views: 188

Bogart UMC

New Member
It would also be nice to have it do a fade transition between advances... But it works great as is once I figured out how it works.
 

dave.hillegass

New Member
JStark,

Thank you for this script. It does what I was looking to do fairly well. If you want to use your script code and get the dropdown to populate with current OBS 2.4 then you need to change line 147 to this:
if source_id == "text_gdiplus" or source_id == "text_ft2_source" or source_id == "text_gdiplus_v2" then

Amirchev,

I really like your adjustments to the script as well. Thank you both for your valuable input.

Thanks,
Dave
 

SopherFellow

New Member
Newbie here,
I may want to use multiple instances of lyrics (making a lyrics1.lua, lyrics2.lua, etc) and it gets tedious to register the hotkeys for all the instances, especially since I'm using the same hotkeys for every instance. Is there anyway within the script that I could hardcode the hotkeys that I intend to use.

Another thing that I have done as a result of having multiple instances is to edit the Toggle lyrics action to also go to the top of the file. This way after I have scrolled down the first lyrics and I go to the 2nd lyrics (which uses the same hotkeys) then it is scrolled down also so I need to reset to the top when I make it visible. Alternatively I could for each action add a "if visible" to ensure that only the currently visible lyric gets affected, but resetting when toggling seemed more straightforward.

Thanks for any help in hardcoding the hotkeys - I have done zero lua scripting - I have had OBS for 4 days!
 

amirchev

Member
Newbie here,
I may want to use multiple instances of lyrics (making a lyrics1.lua, lyrics2.lua, etc) and it gets tedious to register the hotkeys for all the instances, especially since I'm using the same hotkeys for every instance. Is there anyway within the script that I could hardcode the hotkeys that I intend to use.

Another thing that I have done as a result of having multiple instances is to edit the Toggle lyrics action to also go to the top of the file. This way after I have scrolled down the first lyrics and I go to the 2nd lyrics (which uses the same hotkeys) then it is scrolled down also so I need to reset to the top when I make it visible. Alternatively I could for each action add a "if visible" to ensure that only the currently visible lyric gets affected, but resetting when toggling seemed more straightforward.

Thanks for any help in hardcoding the hotkeys - I have done zero lua scripting - I have had OBS for 4 days!
Would this work better for your needs?
 

SopherFellow

New Member
So, I might be too new to understand what is going on but I don't think so. I want to have 20 different text files and display them all one at a time and be able to manually scroll thru each file. Does your script allow me to hook up a bunch of different text files to a single instance of lyrics. Sorry if I'm missing something simple - this is all new to me.
 
Last edited:

JillinFL

New Member
And Yep.... I found it.

You have to write the Text Source by yourself. Not possible to be shown on the dropdown menu.
Thanks again..
Hi, I'm having I think the same problem. How did you find it and fix it? I have the script loaded, I directed to the file, but I can't figure out how to add it as a source. I added a Text (GDI+) to my scene, but nothing happens. Can you help spell it out for me please? Thank you in advance!
 

JillinFL

New Member
Hi, I'm having I think the same problem. How did you find it and fix it? I have the script loaded, I directed to the file, but I can't figure out how to add it as a source. I added a Text (GDI+) to my scene, but nothing happens. Can you help spell it out for me please? Thank you in advance!
I'm impatient and downloaded the 0.2 version. Added Text (GDI+) source to the scene. From Scripts configuration window, I typed "Text (GDI+)" without quotes in the Text Source field. Resized the source that now appears in the scene with the text and I'm good to go with minor adjustments. Thanks!
 

daybreakerflint

New Member
You can make it work by changing source_id = obs.obs_source_get_id(source) to source_id = obs.obs_source_get_unversioned_id(source)

Hello amirchev!
I am currently on writing an addition to the countdown script and I did not find anything about this function source_id = obs.obs_source_get_unversioned_id(source)
I want to grab the information of my audio input sources (Mic and Desktop) and I don't find the unversioned ID. Is there somewhere a link to a list?
Greetings!
 

amirchev

Member
Hello amirchev!
I am currently on writing an addition to the countdown script and I did not find anything about this function source_id = obs.obs_source_get_unversioned_id(source)
I want to grab the information of my audio input sources (Mic and Desktop) and I don't find the unversioned ID. Is there somewhere a link to a list?
Greetings!
I understand it gives you a clean name, instead of a versioned name. So, instead of text_gdiplus, getting a versioned ID may return text_gdiplus_v12. I think that's the difference, just by looking at the source code. There is no real documentation, though. Unfortunately there is little documentation for the whole OBS project.

EDIT: Did a quick test run, it is what I thought. The script I made prints both versioned and unversioned id's, and this is the list the script printed:
Code:
[test.lua] image_source
[test.lua] image_source
[test.lua] ------
[test.lua] text_gdiplus_v2
[test.lua] text_gdiplus
[test.lua] ------
[test.lua] browser_source
[test.lua] browser_source
[test.lua] ------
[test.lua] wasapi_input_capture
[test.lua] wasapi_input_capture
 
Last edited:

Webmaster

New Member
We downloaded the latest Lyrics script and everything works well. However, once we go through all of the three sets of lyrics we've prepared, then the Lyrics hotkeys stop working, and we need delete all of the prepared songs and prepare them again. This is an issue when you are building all of your scenes and do a runthrough. You have to rebuild the lyrics. Is this the expected behavior?
 
Top