This is a bit embarrassing to admit, and I don't mean to be a downer, but I feel like I don't know what I'm doing anymore (which, as a coder, happens to me a lot). I've tried every tip, but I feel like I'm not making any progress. I'm not sure if this is correct, but here's what my current code looks like. Feel free to edit anything.Alright, no worries, take your time and don't neglect "real life" as the skin is no urgency. Yes, the path you took is exactly right, well done!![]()
In the end, Lua won't be necessary and the whole thing really isn't that hard to achieve (you could indeed do everything with regexes). You can (RegExp) Substitute the needed line parts with "+1" in some String measure duplicates of the lyrics measure, followed by using Calc measures with the said String measures in their Formula options, to compute how many lines the lyrics has in total and how many lines there are until the currently played line. Then, you could scroll and change the Y of the lyrics meter based on the currently played line. This is because you can find the line height by dividing the lyrics text meter's height (i.e. [MeterLyrics:H]) by the number of total lines in the lyrics and you can modify the Y by adding or subtracting a product of line height and the number of lines until the currently played line.
Also, you don't need all the timestamps or to save them anywhere in this approach - for both scrolling like above and highlighting the currently played line, you only need to find where the currently played line is in the lyrics string. For example, I already do karaoke highlighting in the sample skin I wrote, by using inline settings in a meter similar to this (I left only the relevant parts for clarity and used the names from the skin you linked to, to better get the idea; by the way, I only used the character variable for [ because using the literal seems to cause problems when used from a !SetOption bang since it's right near the [section] markers):Code:
[MeterLyrics]...Meter=String...X=...Y=...W=...InlineSetting=Color | 255,0,0,255InlinePattern=(?siU)\[\x005B][MeasurePosition].*\RMeasureName=MeasureGetSyncedLyricsText=%1DynamicVariables=1

Statistics: Posted by Rhyuno — Today, 12:11 pm