[PD] Controlling PD via the serial port?

Mathieu Bouchard matju at artengine.ca
Fri Aug 5 12:13:18 CEST 2005

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 

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

More information about the Pd-list mailing list