Skip to content
Forum Archive

parsing $(title) strings

20 posts

toqer#

parsing $(title) strings

Let's say my title has delimeters in it, example, using "-" as a delimeter below.

Bob - Elvis Presley - Hound Dog

I want to put each field in a seperate text renderer, so it displays in AVS like this.

Bob
Elvis Presley
Hound Dog

Anyone got any ideas on how to do this?

--toq
MaTTFURY#
I don't think AVS has any kind of multi-line text support, or did you mean play song - show title, play next song move 1 space down? if so i think you'd have to use a counter of some sort so it'd be ...

Frame: counter=counter+0.01 // the greater the number the quicker it should go.
Point: x=counter*$(title)&if(title,vartrue,varfalse);

But I'm not entirely sure if AVS has any kind of support for using $(title) in the actual superscopes or anything ...
JFASI#
That would be useful. What I do sometimes is draw Render-Text, and save that to a buffer, etc..
toqer#
Yah I think superscope support was what I was asking about, like load $(title) as a superscope variable, then each delimeter would split the title into 3 more variables.

I'm dumb with AVS, but hopefully this can make some sense.
Bob - Elvis Presley - Hound Dog
^------^---------------^--------->>Variable1
       L---------------|--------->>Variable2
                       L--------->>variable3 
So the contents of $(title) variable gets rendered into the superscope. Superscope looks for the "-" delimeter, then passes whats in between the "-" delimeter to 3 different render>text effects

Render>text>Variable1
Render>text>Variable2
Render>text>Variable3

(btw this is for my karaoke purposes) This way I can display the singers name, the song title, and the artist on 3 different lines in AVS while the singer is singing.
fastingaciu#
this is exactly what t0qer sad.
toqer#
Not even close fasting, but looking at your example will let me use the correct terminology.

I've attatched poo.zip, it's nothing near what I need, but maybe a brief explanation of what i'm using it for will help.


I overlay AVS behind karaoke lyrics. There's a nice timer that shows the singer how long until their song ends (lower left corner) then 2 render text's to display the $(title), but the way i'm displaying the $(title) is sort of messy. Stuff goes off screen, I have to do weird stuff, it's no good.

Ok, here's what I need again, with better terminology.

I want the contents of $(title) to go into a reg00

Reg00 string is read till it hits a "-", everything up to "-" goes into Reg01

Reg00 is read again, everything from the first "-" delimeter to the second "-" delimeter is put into reg01

reg00 is read a third time, everything after the second "-" delimeter is put into reg03

So to recap.

"-" is a delimeter, THINK DATABASES

Reg00 = $(title)
Reg01 = Text up to the first "-" delimeter
Reg02 = Text from the first "-" to the second "-" delimeter
Reg03 = All text after the second "-" delimeter

Is this something that can be done in a superscope at all?

--toq
MaTTFURY#
I don't think so sorry, but maybe with a dynamic movement! 😁 Just apply the same principles through the dm as the ssc. 🙂
toqer#
I know yall hate "Can you do it for me cause I don't know wtf i'm doing" but could you do it for me matt?
PAK-9#
I might as well save you some time here...

You cant do what you are asking in AVS. The text support is very poor, the $(title) support was only added in the latest version and all it does is display the song title directly in a render/text.

- You cannot retrieve the song title/artist/number/albumn/etc... independantly
- You cannot put text into variables
- You cannot perform any processing on text

Sorry, render/text is one of the worst things about AVS
StevenRoy#
Agreed.

Still, as with most AVS limitations, there may be a way around it. It may require some trickiness, though.

For example, my first idea is to consider using the time() function to get the length of the song, which can be used to determine which song is being played. Then you can code Effect Lists, one for each song, each with as many Render/Text objects you need to display the appropriate information for each song, exactly the way you want it.

It's a bit of a cheat, really, but the approach might work.

If you have more than just a few songs, though, this is going to be really tedious. Also, you're likely to have problems if you have two songs that are the same length!
PAK-9#
That technique assumes a fixed playlist as well, a more concrete solution would be producing an APE... but we've had the old text2 discussion before and nothing has come of it
toqer#
Coding for each song would be impossible, at least the way I use AVS for my karaoke shows. Bummer $(title) can't be parsed, I can settle with what I have for now. Thanks for setting me straight on this guys.
Warrior of the Light#
The main reason why Text2 hasn't been created yet is mainly because text is pixel-based.
AVS mainly runs in small resolutions, so the size of the text often exceeds the AVS window.
Also, the position of the text in a preset is resolution-dependent, so there's no telling what the position of the text will be at the user's end.
Overall: Text and AVS simply don't match very well.

If anyone feels like creating Text2 go ahead, but realize that it won't be used (shouldn't be used) as much in the first place.

Toqer:
Perhaps there is a way to get the song info from winamp itself instead of from AVS, and create a small app that has the AVS overlay color as background and shows the text in the beamer's resolution instead of in AVS's resolution (stated you're using overlay mode of course)?
toqer#
This is how i'm using it now,



Title is at the top, little countdown timer in the lower left corner to let singers know how long till their song is over. (D singing crazy)

Not all fonts are bitmap, Postscript and Truetype are both vector fonts.

Creating an app? Heh, I can't code anything, unless you like atari basic.


Creating an app is an ok solution, but I already scale the karaoke screen to fit IRC text on the bottom, and don't wish to scale it any further, also I have it set to be always on top (in case an annoying little popup from a website happens to wander over on that monitor if im surfing) So between those two points, it would just be better if it was built into AVS.
Warrior of the Light#
Sorry if I was unclear about the text size.. What I meant was that the size of the characters is pixel-based. Of course there are different fonttypes.
What I meant was that you can't, for instance, code a character to be 1/100 of the screenwidth.
jheriko#
The reason it hasnt been made is because its not worth the time needed to make it... its not hard... its just a lot of time and effort to make a user friendly and powerful text replacement.