simple comp to display lines of text from file

steev's picture

This quartz composition reads text from a file and then displays it one line at a time over and over. Intended to be brought into Resolume and manipulated.

I'm just getting started with QC, looked around for other posted compositions and patches for doing this and never really saw quite this. Hopefully this is useful to others. I couldn't figure out how to split s string on newlines natively in QC so used javascript patch. This probably is a performance hit, I would think, so if anyone knows a better way... (I want the input file to be able to be just plain text, i don't want to have to convert to XML or some other format.)

cheers, steev

PreviewAttachmentSize
text iterator.qtz33.15 KB

jersmi's picture
Re: simple comp to display lines of text from file

Using the String Components patch with a separator, I believe option-return is a valid symbol to use line breaks as separators.

steev's picture
Re: simple comp to display lines of text from file

nope, option-return as a separator in String Components doesn't appear to work. i've also tried, without luck, \n and \r and \n\r and \r\n, which are how'd you represent newlines and carriage returns in most programming languages.

jersmi's picture
Re: simple comp to display lines of text from file

works for me.

PreviewAttachmentSize
string_components_linebreak.qtz7.2 KB

steev's picture
Re: simple comp to display lines of text from file

huh. maybe we're running different versions of QC and it's a bug they fixed? i'm only on OS X 7 so i can only run QC 4.6.

jersmi's picture
Re: simple comp to display lines of text from file

afaik, option-return has always worked, so i don't know.... i'm currently on 10.9 running the newest Graphics Tools / QC 4.6.

steev's picture
Re: simple comp to display lines of text from file

jersmi wrote:
afaik, option-return has always worked, so i don't know.... i'm currently on 10.9 running the newest Graphics Tools / QC 4.6.

This is odd, I opened up your composition and cut-and-pasted your instance of the string components patch into my comp, and now it works. but when i was typing option-return in myself it wasn't. oh well. i also saw you were using interpolator, which seemed more straightforward than wave generator, so i switched to that. so thank you on 2 fronts.

parallaxvisuals's picture
Re: simple comp to display lines of text from file

steev wrote:
This quartz composition reads text from a file and then displays it one line at a time over and over. Intended to be brought into Resolume and manipulated.

I'm just getting started with QC, looked around for other posted compositions and patches for doing this and never really saw quite this. Hopefully this is useful to others. I couldn't figure out how to split s string on newlines natively in QC so used javascript patch. This probably is a performance hit, I would think, so if anyone knows a better way... (I want the input file to be able to be just plain text, i don't want to have to convert to XML or some other format.)

cheers, steev

thanks man! this helped me put subtitles to a live show! you rock!!!