Hi - I'm posting to other lists too of course, so sorry for crosspost.
I am currently, among other things (one step at a time), trying to figure out how to control PD via the serial port. that is the question of the hour. just want to use hyperterminal to send a word, like "hello", and have pd do something based on that word, like print hello or something.
for background, the project (due tommorrow, handed to me last night) is:
a button box has 6 buttons: five record and one play. when a child who is standing between a green screen and a camera (connected to s-video input of a capture card) hits, say, record 1, a chip inside sends the text "record1" to a serial output. on the other end, a computer running max/jitter or pd/gem (probably the former) plays back a set video file (a different one if it's "record2"), placing it in the fill of a chroma key, and records the composite of the camera and the fill for 20 seconds, while the kid dances around in front of the background. if the kid pushes the play button, the last combined video is played back via the s-video output of the regular video card.
i don't even have max yet cuz they haven't sent the serial number. so all I want to do this minute is send the word "play" to PD via the serial port and have it do something, anything, even just say hello. i'm very new to PD though. I can get it to, for example, print hello in its terminal. but so far documentation i read makes me think that the "serial" object only outputs to the serial port as opposed to reading from it and parsing what it's getting...
Aaron Trumm www.nquit.com
On Thu, 4 Aug 2005, Aaron Trumm wrote:
I am currently, among other things (one step at a time), trying to figure out how to control PD via the serial port.
The first step is using the [comport] external. It works on both Linux and Windows.
This will spit float messages out, each being a byte from the comport.
send a word, like "hello", and have pd do something based on that word, like print hello or something.
[comport] will re-emit that as 104, 101, 108, 108, 111.
Parsing that could be a chore unless you are using certain externals.
for background, the project (due tommorrow, handed to me last night) is:
That's a quite short-term project. Maybe you could give your boss a good whack behind his/her head... unless you're getting back a large reward for doing it.
a button box has 6 buttons: five record and one play. when a child who is standing between a green screen and a camera (connected to s-video input of a capture card) hits, say, record 1, a chip inside sends the text "record1" to a serial output.
If you only have 6 possible commands without parameters, then it will be simpler for you to use single-byte commands. In hyperterminal that could be any key that has an ASCII code. Keys that have an ANSI-VT code instead are multi-byte and are thus more difficult to handle; e.g. the code for right-arrow is three bytes: 27,91,67.
Do you have control over what the button box can send? can it send single bytes ?
"serial" object only outputs to the serial port as opposed to reading from it and parsing what it's getting...
I don't recall there being a [serial] object, or at least not anyone who actually uses it.
Mathieu Bouchard - tél:+1.514.383.3801 - http://artengine.ca/matju Freelance Digital Arts Engineer, Montréal QC Canada
Le 5 Août 2005 06:13, Mathieu Bouchard a écrit :
On Thu, 4 Aug 2005, Aaron Trumm wrote:
I am currently, among other things (one step at a time), trying to figure out how to control PD via the serial port.
The first step is using the [comport] external. It works on both Linux and Windows.
This will spit float messages out, each being a byte from the comport.
send a word, like "hello", and have pd do something based on that word, like print hello or something.
[comport] will re-emit that as 104, 101, 108, 108, 111.
Parsing that could be a chore unless you are using certain externals.
May I suggest to use my ascii externals? http://puredata.org/Members/odradek/ascii-0.1.1.tar.bz2/file_view
-- Marc
Marc,
Have you done any work on this? adapted to the new flext build-system? put into CVS? Would you like me to do this? Maybe under externals/lavallee?
B.
Marc Lavallée wrote:
Le 5 Août 2005 06:13, Mathieu Bouchard a écrit :
On Thu, 4 Aug 2005, Aaron Trumm wrote:
I am currently, among other things (one step at a time), trying to figure out how to control PD via the serial port.
The first step is using the [comport] external. It works on both Linux and Windows.
This will spit float messages out, each being a byte from the comport.
send a word, like "hello", and have pd do something based on that word, like print hello or something.
[comport] will re-emit that as 104, 101, 108, 108, 111.
Parsing that could be a chore unless you are using certain externals.
May I suggest to use my ascii externals? http://puredata.org/Members/odradek/ascii-0.1.1.tar.bz2/file_view
-- Marc
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Le 5 Août 2005 11:09, B. Bogart a écrit :
Marc,
Have you done any work on this? adapted to the new flext build-system? put into CVS?
No, I'm too busy being lazy. ;-)
Would you like me to do this? Maybe under externals/lavallee?
I should take this opportunity to get back to flext, because I'm supposed to talk about it at the next tp-mtl meeting... So your help would be much appreciated. I hope the new build system allows easier compiling on non-linux systems. -- Marc
Ok, what can I do to help? Would you like to meet on IRC to talk about it? I'm pretty available during the day.
b>
Marc Lavallée wrote:
Le 5 Août 2005 11:09, B. Bogart a écrit :
Marc,
Have you done any work on this? adapted to the new flext build-system? put into CVS?
No, I'm too busy being lazy. ;-)
Would you like me to do this? Maybe under externals/lavallee?
I should take this opportunity to get back to flext, because I'm supposed to talk about it at the next tp-mtl meeting... So your help would be much appreciated. I hope the new build system allows easier compiling on non-linux systems. -- Marc
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Aaron Trumm wrote:
Hi - I'm posting to other lists too of course, so sorry for crosspost.
I am currently, among other things (one step at a time), trying to figure out how to control PD via the serial port. that is the question of the hour. just want to use hyperterminal to send a word, like "hello", and have pd do something based on that word, like print hello or something.
for background, the project (due tommorrow, handed to me last night) is:
Still in time?
a button box has 6 buttons: five record and one play. when a child who is standing between a green screen and a camera (connected to s-video input of a capture card) hits, say, record 1, a chip inside sends the text "record1" to a serial output. on the other end, a computer running max/jitter or pd/gem (probably the former) plays back a set video file (a different one if it's "record2"), placing it in the fill of a chroma key, and records the composite of the camera and the fill for 20 seconds, while the kid dances around in front of the background. if the kid pushes the play button, the last combined video is played back via the s-video output of the regular video card.
use [comport] indeed. I use it to read output from a pic and read from sensors. However, if the thingy is sending 'text' like record1, using comport can be quite bothersome IMHO, after prototyping in pd I use perl to parse it's as simple as wrinting this:
open(TTY, '<', "/dev/ttyS0"){ if(/"record1"/){ system("sendosc $params"); elsif( ... etc.
but I can recommend comport you'll have to build something to parse with and linux. If you're looking for something quick and dirty to chromakey directly from the v4l and control it through PD, use 'veejay' and the 'sendVIMS' external.
i don't even have max yet cuz they haven't sent the serial number. so all I want to do this minute is send the word "play" to PD via the serial port and have it do something, anything, even just say hello. i'm very new to PD though. I can get it to, for example, print hello in its terminal. but so far documentation i read makes me think that the "serial" object only outputs to the serial port as opposed to reading from it and parsing what it's getting...
comport iswhat you need.
good luck
Aaron Trumm www.nquit.com
PD-list@iem.at mailing list UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list
Just to add another ways to get buttons in pd, which I used in my last installations:
Cheers,
Malte Steiner media art + development -www.block4.com-
new releseas: Elektronengehirn: new composition on http://www.bremsstrahlung-recordings.org/transradiation/trans002.php
Konform: new song on Acido03 12" compilation
more at blog 4, also available as rss feed: http://java.block4.com/blog4/