I am in the process of planning a new project that involves the use of a scanner. Somehow I need to read the data that the scanner is sending over the USB port into PD. Is something like this allready done so I could have an example?
So far I only came acrosse the SANE project a JAVA lib. called Morena and ofcourse TWAIN. I assume that nobody is going to hand me a ready made code, so I am thinking how I should aproach this. Here's how I think the basic should be like.
should always be on!) 2) format the data into OSC and send it via UDP 3) set PD up to listen to a specific port.
I would really appreciate some feedback so I can continue in the right direction.
Thank you,
Jiri
hi.
Jiri Heitlager | dadata.org wrote:
So far I only came acrosse the SANE project a JAVA lib. called Morena and ofcourse TWAIN. I assume that nobody is going to hand me a ready made code, so I am thinking how I should aproach this. Here's how I think the basic should be like.
- make an JAVA app that reads in the scanner data (continously, lamp
should always be on!) 2) format the data into OSC and send it via UDP 3) set PD up to listen to a specific port.
i would set up pd to listen on the port _before_ sending data to it (swap #2 and #3)
whether this is a good setup depends on "the data" you want to send. (you are rather vague about that).
if the data is more complex (images,...) i would suggest to NOT use OSC to directly send the data (even though OSC itself can afaik handle blobs, pd/OSCx is not so good at it).
personally i would just setup a "server" process (be it written in java, python, C or whatever) which continously reads in the data (either via a cron-job, or an internal or external loop), store it on the harddisk and then tell pd where it should look for the data. mostly i use pdsend for this, but that is why a lot of my servers are written in bash (hey, it's fun...); you might as well send the push-command directly from your java-app.
mf.asdr IOhannes