[SOLVED] Formating one text input into scroll



  • Hi,

    For a project i'm using the twitter API to stream all the tweets of the 10 most trending topics worldwide into Isadora.
    I'm monitoring the twitter activity and sending each tweet through one OSC channel into Isadora with a node.js program, then I did the attached user actor to format the input into some scroll effect.
    Everything is working, but it's decreasing a lot the performances of Isadora (down to about 14 fps) and this is just a little part of the project, so I probably can't afford to be that much on the edge for that...
    The refreshment rate is pretty high (probably around 48Hz) and I know for sure that my method is not the best, it's just the only work around I've found so far...
    I've tried to find a way with javascript actor just to format the text input (unsuccessfully so far), but I'm sure there's better solution than OSC to get the text data: maybe a way to directly get the data into the javascript actor?
    I also remember seeing a text actor which was loading text from external file (but can't find it anymore), maybe this could work with my node.js writing data to text file?
    I'm opened to any suggestion, attached is my "inefficient" actor
    Thanks!
    Edit: looking at @DusX Tcp tutorial now (http://www.dusxproductions.com/blog/web-apis-in-isadora-part-1/) could be a solution if I run my node on a server instead of locally ?

    7dcdbd-twit-feed.iua


  • Tech Staff

    I think @DusX is your man to help here.

    I used to use twitter when it was the older XML method and then just import as text, etc But I have never found another good solution since it updated to JSON.
    Good luck - hope you solve it. 


  • @Maxime Is this the plugin you are looking for?

    best

    82e2fd-readtextfromfile.izzyplug.zip



  • @gapworks yes thanks! maybe I can try to find a way with that


  • Tech Staff

    The plugin is great, but you will have a hard time writing to it, and reading from it simultaneous.

    Your performance issue is probably due to the Text Draw actor being combined so often. You could try combining all the text using the 'Text Formatter' actor.

    You can combine 6 inputs together with line breaks between with this formatting string:
    " P1 0D 0A P2 0D 0A P3 0D 0A P4 0D 0A P5 0D 0A P6"

    This actor allows a max of 9 inputs, so you would need to chain a few together to make your 24 lines.
    If this is still slow (I suggest you add a multi-blocker to the input.. 48hz is too much) Try the Classic Text Draw actor.. it uses more CPU but handles large strings better.

    I have had to use it to overlay large arrays of formatted data in my own work.

    Regarding the TCP option.. if you can get the data in JSON format from Twitter, this might be a good option... although at the high refresh rates you are using, I have not tested.
    You may want to read the tutorial on ungrouping JSON data:
    http://troikatronix.com/support/kb/grouping-ungrouping-and-passing-json-values/

    It will likely be of help if you try that option.


  • Dear @Maxime,

    The first problem I see is that you the video mode of the Text Draw actors is vid-cpu. You should re-build this actor so that it is vid-gpu, so that – at least – the mixing of the images is performed on the GPU. Also, I would not "daisy chain" the actors. Instead, I would use a MultiMix actor to combine the video output of all the actors into one video stream.
    Please try the attached User Actor, which I modified to use the GPU and was created in v2.2.2\. See if that helps the frame rate.
    Best Wishes,
    Mark

    97eb46-twit-feed-gpu-version.iua



  • Thanks for your answers.

    @mark I am going to check your actor with the multi mix instead of the daisy chain text draw.
    I've tried a version with the GPU and somehow it was a bit less performant, but my laptop is a bit old, my graphic card only NVIDIA GeForce GT 330M 256 Mo, that might be part of the problem.
    After my post I've tried a "one-liner" version with one text draw actor, and it's not running so great either, so I guess the high refreshment rate is a major part of the problem.
    I'm going to try to write, as @DusX suggested, a new JSON file every 2 minutes and load it to see how it goes, it's not "real" live anymore but I guess it's the best bet for good performances.
    Thanks everyone for your inputs, I'll get back to you with my results.


  • Dear @Maxime,

    What is the "Default Resolution" setting in the Video Tab of the preferences? Since you haven't specified a resolution explicitly in the Text Draw actor, this is the resolution that will be used when generating video. If it is very high, this will impair performance.
    Remember, drawing text is not done on the GPU. Text is drawn into bitmaps on the CPU side. Rendering 24 of those can be costly if the resolution is high.That's why @DusX's idea to concatenate the text first and then use one Text Draw actor would help a lot in terms of performance. Attached please find a patch with a Javascript actor that will concatenate 24 lines of text, separating them with carriage returns into separate lines. That would be the best way to go if you can do so.
    Best Wishes,
    Mark

    77df59-javascript-concat-24-text-inputs.izz



  • Thanks a lot!

    @mark my default resolution was 640x360 
    Your javascript actor helped me a lot to go through my system!
    I made four of it to be able to have continuous scroll and be able to "fill the buffer" out of view.
    It might still not be the most elegant way of doing it, but it's working at 30fps, so I consider it as a solved problem (even though I might try to make it better for fun)
    I really need to work on this Javascript actor!

    b453db-twit-format.izz


Log in to reply
 

Looks like your connection to TroikaTronix Community Forum was lost, please wait while we try to reconnect.