I've been looking around the forum, but I'm a bit lost since I don't know exactly what I need to do what I want...
I'm doing an interactive installation where animated graphic from Processing will be projected on a big pyramid (using madmapper).
So what I want to do :
People will go to a website from their phone
They will be able to enter a word
They will "send" that word somewhere (probably a server but I don't know how it work)
When the word is sent, it will appear on my pyramid (so Processing needs to be able to get that word somewhere in realtime)
I suppose the website part will be done in PHP, but I'm wondering how to do the step 4 above, especially in realtime, so that each time a new word is 'sent' (or written on a file), my installation updates itself and display this new word..
I don't ask for the code, but rather the best way to do this...
The concept of 'real time sending' is not really accurate in this
context. It's more that Processing will retreive data every once in a
while. You can use threads to do this, so it won't slow down your draw()
loop. Once the data is retreived, the program can act upon it. Since Processing is quite flexible in it's ability to acquire and parse data, I would focus on the website part. It depends on your needs and technical ability how far you can, want and need to take it.
If you mean that you have a 'one word installation' then of course a
simple text file would suffice, which just holds the latest word. Processing would be able to read that. But I'm assuming you want to display more words. Then you still could append a text file with PHP. The advantage is that it's relatively straightforward. The disadvantage is that the text file grows in size and you have no additional information (although you probably could remove words as well). Another option is to add to an XML with PHP. That would allow nodes of combined information, for example a word and a timestamp in the least. Then Processing can distinguish words using the timestamp. Which would allow removal of nodes from the XML after a certain time and/or above a certain number of nodes. The advantage of this is that you can keep the filesize small (= faster loading) even if it runs weeks and processes many words. Just thinking out loud here.
I suppose any solution would require an iterative development process starting with some technical tests.