Resource icon

OBS Lyrics 2.0.0

LarryResch

New Member
I really like this script and think it would be quite useful in our streaming of worship!

My main suggestion is a way to display less lines than the setting. For example, say I have a song with 4 lines per verse, but only 3 lines in the chorus. There is no way to display this - if I put a blank line in the lyrics, when I click on Prepare Song, the blank like is removed.

It would also be nice if the lyric file stored the number of display lines so that if I have one song that I want to display 4 lines and another to display 6, I don't have to change that in the script and then run Prepare again.

Once again, great script!
 

alfonsoon

New Member
Hello,
My OBS crashes when using this Lyrics Plugin. I assigned Ctrl + UP, DOWN, RIGHT, LEFT to prepare next or previous, and advance or go back on the lyrics.
Here is my crash log: https://obsproject.com/logs/rLfSzuGQ2Q0xW4tW

Is there a way to avoid it from crashing? It does not crash everytime, it appears to be random.
It has not happend by clicking the Next or Previous Buttons. Only when used through HotKeys
 

amirchev

Member
Hello,
My OBS crashes when using this Lyrics Plugin. I assigned Ctrl + UP, DOWN, RIGHT, LEFT to prepare next or previous, and advance or go back on the lyrics.
Here is my crash log: https://obsproject.com/logs/rLfSzuGQ2Q0xW4tW

Is there a way to avoid it from crashing? It does not crash everytime, it appears to be random.
It has not happend by clicking the Next or Previous Buttons. Only when used through HotKeys
Hey alfonsoon,

Is it a particular song? And are you trying to advance lyrics or change to the next song? Also, have you tried using different hotkeys? I'm not able to tell very much from the crash log, but it does appear to crash in response to your hotkey press.
 

alfonsoon

New Member
Hey alfonsoon,

Is it a particular song? And are you trying to advance lyrics or change to the next song? Also, have you tried using different hotkeys? I'm not able to tell very much from the crash log, but it does appear to crash in response to your hotkey press.

Yes, I've tried different hotkeys. For example: just the arrows, the arrows+CTRL, the F#keys). It happened with different songs and at random points.
It happened with different songs and the crash log is not very telling with this issue, at first I thought it was OBS crashing, but until this crash I narrowed it down to when I was using this plugin with Hotkeys. I cannot remember if I was going fowards or backwards on the lyrics.

I've have also tried to replicate the crash, but was not succesful. It was only happend to while streaming.
 

Webmaster

New Member
We really like this script. However, it is a pain to have to "prepare" the songs again whenever you restart OBS. We have someone enter the song lyrics on Thursday, but the volunteer running OBS on Sunday needs to "prepare" the lyrics again, even if they were "prepared" on Thursday. Is there any way to save the "Prepared" lyrics so we don't need to keep "preparing"?
 

Surge42

Member
amirchev I love your plugin. It took me quite a while to figure out how to set it up but I got it. I'm going to make a full video on why your software ROCKS, how to set it up, and more. THANKS BROTHER.
 

amirchev

Member
amirchev I love your plugin. It took me quite a while to figure out how to set it up but I got it. I'm going to make a full video on why your software ROCKS, how to set it up, and more. THANKS BROTHER.
Glad you find out useful! Please post a link here of the video so people can find it more easily.
 

DCStrato

Member
Amirchev,

I needed different songs to have a different number of "display lines" to better match singing whole verses or having logical divisions. I modified your prepare_lyrics function to look for "#L:" markup at the beginning of a line (typically the first line of the song), followed by the number of display lines to use for that prepared song. So the first line of a song typically now looks like #L: 4 for grouping 4 lines at a time, or $L:5 for 5 lines at a time. If it doesn't find the string it does nothing, so older files still work with the new modifications.

Thanks for a great script!
-------------------------------------------------

-- prepares lyrics of the song
function prepare_lyrics(name)
if name == nil then return end
local song_lines = get_song_text(name)
local cur_line = 1
lyrics = {}
local adjusted_display_lines = display_lines
for _, line in ipairs(song_lines) do
local single_line = false
if line:find("###") ~= nil then
line = line:gsub("%s*###%s*", "")
single_line = true
end
local comment_index = line:find("%s*//")
if comment_index ~= nil then
line = line:sub(1, comment_index - 1)
end
local newcount_index = line:find("#L:")
if newcount_index ~= nil then
adjusted_display_lines = tonumber(line:sub(newcount_index+3))
line = line:sub(1, newcount_index - 1)
end
if line:len() > 0 then
if single_line then
lyrics[#lyrics + 1] = line
cur_line = 1
else
if cur_line == 1 then
lyrics[#lyrics + 1] = line
else
lyrics[#lyrics] = lyrics[#lyrics] .. "\n" .. line
end
cur_line = cur_line + 1
if (cur_line > adjusted_display_lines) then
cur_line = 1
end
end
end
end
if ensure_lines and cur_line <= display_lines then
for i = cur_line, adjusted_display_lines, 1 do
lyrics[#lyrics] = lyrics[#lyrics] .. "\n"
end
end
lyrics[#lyrics + 1] = ""
end
-----------------------------------------------------------------------------
DCStrato
 

DCStrato

Member
The last if statement in that function was throwing an error if "Strictly Ensure Number of Lines" was checked and no songs were prepared. I made this modification that seems to fix it, but not sure if it was anything I did with the other small change. I did notice I had cur_line <= display_lines rather than adjusted_display_lines in the last post, so here is the combined correction with the nil check.

if ensure_lines and cur_line <= adjusted_display_lines and (lyrics[#lyrics] ~= nil) then
for i = cur_line, adjusted_display_lines, 1 do
lyrics[#lyrics] = lyrics[#lyrics] .. "\n"
end
end
 

DCStrato

Member
Alfonsoon,

This version of OBS Lyrics has a "Source" added that allows songs to be dynamically prepared when a scene is loaded. It also allows for the "#L:" markup in the song file. Adding a first line like #L:5 would overwrite the number of lines used by that song, allowing display line count to vary by song. If you add a Prepare Lyric Source to a scene, it allows you to select the song from the same list as the script, and automatically renames that source in the scene to "n. Prep lyrics to: name of song " so it's easy to read what song is being prepared in each scene. I also changed the source of the songs within the script to be a table rather than the script source. This allowed me to save songs loaded the original way so they are ready when OBS starts. But you don't really need to pre-prepare songs if you use the source option in scenes to load them dynamically. All of this is just some small additions to the wonderful code already provided by Amirchev, but it does address some of your listed concerns if you want to give it a try.

DC
 

Attachments

  • lyricsplussource.zip
    4.9 KB · Views: 40

amirchev

Member
Here's the link to the tutorial. This video explains how to use Amirchev's FANTASTIC script in a very easy way. ENJOY!

Thanks again for the hard work Amirchev!
You're welcome, it was done for a good purpose - to help churches with their livestream. Thank you for the shout-out! I'll post an update with a link to the video.

Alfonsoon,

This version of OBS Lyrics has a "Source" added that allows songs to be dynamically prepared when a scene is loaded. It also allows for the "#L:" markup in the song file. Adding a first line like #L:5 would overwrite the number of lines used by that song, allowing display line count to vary by song. If you add a Prepare Lyric Source to a scene, it allows you to select the song from the same list as the script, and automatically renames that source in the scene to "n. Prep lyrics to: name of song " so it's easy to read what song is being prepared in each scene. I also changed the source of the songs within the script to be a table rather than the script source. This allowed me to save songs loaded the original way so they are ready when OBS starts. But you don't really need to pre-prepare songs if you use the source option in scenes to load them dynamically. All of this is just some small additions to the wonderful code already provided by Amirchev, but it does address some of your listed concerns if you want to give it a try.

DC
Hey, thanks for your work. I will look over and test the script. Hopefully will get it in production sooner than later.
 

DCStrato

Member
I really like this script and think it would be quite useful in our streaming of worship!

My main suggestion is a way to display less lines than the setting. For example, say I have a song with 4 lines per verse, but only 3 lines in the chorus. There is no way to display this - if I put a blank line in the lyrics, when I click on Prepare Song, the blank like is removed.

It would also be nice if the lyric file stored the number of display lines so that if I have one song that I want to display 4 lines and another to display 6, I don't have to change that in the script and then run Prepare again.

Once again, great script!
Larry,

We ran into the same issues at FUMC. If you want to help test, the script I attached in this discussion thread includes an embedded Line Count change that can be added to the first line of each song. Good idea for the added phantom line marker when chorus and verse don't match the line count. We have been adding a "-" or "." on a line to manage a common denominator as a blank line is currently ignored. I started to work on that and opted to add the source loader first. I will add that phantom line option as we would probably use it every Sunday. I may be able to add a variable line option that changes lines per page of a current lyric, but will start with the phantom option so I know OBS will keep the spacing clean and avoid some of the inner/outer bounding box issues. I am not trying to take over for Amirchev who did/does a beautiful job starting/running this project, just writing code very selfishly for my own use at FUMC and sharing the changes to the world.

DCStrato
 

DCStrato

Member
Larry,

Here is a version that now allows you to add a ##P markup to the Lyric as a phantom placeholder line to help match up those crazy 4 line verses and 3 line choruses. Just use ##P at the beginning of a line by itself like a comment. You can put whatever text you want after the ##P and it will be ignored and the entire line will be replaced with a single space. All my preliminary tests show it works but you should test it in your environment just to be sure.

DCStrato
 

Attachments

  • lyricsplussource.zip
    4.9 KB · Views: 46

DCStrato

Member
is the text gdi option only availabe for windows version
Hey,

I know Amirchev is working on doing some code consolidation. I sent him this ##P option, a "source" that allows for loading lyrics automatically by scene, a fade in/out transition option, an option to add "#L:" followed by a number in the lyrics that overrides the line count for that song, a reset hot key, and a change to allow paging backwards through a song. I think he was going to add the OS independent file stuff and offer and update soon. I am guessing he has some other stuff as well. Everything else should be OS independent.

DCStrato
 

amirchev

Member
Hey,

I know Amirchev is working on doing some code consolidation. I sent him this ##P option, a "source" that allows for loading lyrics automatically by scene, a fade in/out transition option, an option to add "#L:" followed by a number in the lyrics that overrides the line count for that song, a reset hot key, and a change to allow paging backwards through a song. I think he was going to add the OS independent file stuff and offer and update soon. I am guessing he has some other stuff as well. Everything else should be OS independent.

DCStrato
Hey DCStrato, thanks for the great work. Just wanted to update everyone that all of these changes are now live.
 
Top