We are about to switch to a new forum software. Until then we have removed the registration on this forum.
Hi,
I'm new here so apologies if I have posted this in a wrong place, please let me know.
I would like to be able to 'hack' the on screen readout from a program I have which displays a piano keyboard on screen, with any key being played turning from black/white to red, for the duration of the note. There is no way to interface with the program itself, or the source of the music (my voice.) I was hoping to be able to grab this information from the screen itself in real time, with as little lag as possible, and relay it to probably an arduino, to use it in various ways.
I could build an array of carefully spaced light dependant resistors and tape it to the screen, and carefully line it up, while hoping it doesn't fall off, or I could use some software running on the PC to read to colour changes at specified pixels instead.
Is the second option likely to be achievable using processing?
I just want to get a general sense of whether processing is the right language for this, or if maybe it isn't possible using any language?
Thank you,
M21
Answers
Perhaps you should take a peek at Robot class:
http://docs.oracle.com/javase/8/docs/api/java/awt/Robot.html
http://forum.processing.org/two/discussions/tagged/robot
So a robot object can be made to return the pixel colour of a defined pixel within it's specified area of the screen, outside processing's sketch window; that certainly sounds like what I'm after.
I guess I could 'scan' the relevant pixels in a loop, and use any changes found to trigger an event like sending a value to an arduino via usb that is specific to that change...