Archive: parsing $(title) strings


17th December 2005 07:23 UTC

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


17th December 2005 12:56 UTC

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 ...


17th December 2005 16:04 UTC

That would be useful. What I do sometimes is draw Render-Text, and save that to a buffer, etc..


18th December 2005 03:30 UTC

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-ElvisPresley-HoundDog
^------^---------------^--------->>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.

18th December 2005 04:34 UTC

this is exactly what t0qer sad.


18th December 2005 05:54 UTC

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


18th December 2005 06:27 UTC

I don't think so sorry, but maybe with a dynamic movement! :D Just apply the same principles through the dm as the ssc. :)


18th December 2005 07:07 UTC

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?


18th December 2005 12:44 UTC

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


19th December 2005 21:32 UTC

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!


19th December 2005 21:45 UTC

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


20th December 2005 01:32 UTC

Text2? Linky please...

I know, I can't find it...sry.


20th December 2005 12:51 UTC

Originally posted by PAK-9
..nothing has come of it

20th December 2005 13:54 UTC

It's still a decent idea...Even if it collapsed.


20th December 2005 17:32 UTC

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.


20th December 2005 17:48 UTC

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)?


20th December 2005 21:05 UTC

This is how i'm using it now,

http://www.7bamboo.com/albums/album09/avstitle.png

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.
http://www.7bamboo.com/albums/album09/woowoosound.png

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.


20th December 2005 23:31 UTC

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.


21st December 2005 16:39 UTC

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.


21st December 2005 17:55 UTC

User friendly can be a pain...