[PD] Controlling PD via the serial port?

Matthijs van Henten cola at looze.net
Fri Aug 5 12:57:55 CEST 2005

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"){
		system("sendosc $params");
	... 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 at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/listinfo/pd-list

More information about the Pd-list mailing list