[PD] Scheduling events, libpd, and sequencing

Peter Kirn peter at createdigitalmedia.net
Wed Feb 16 15:01:39 CET 2011


On Wed, Feb 16, 2011 at 5:23 AM, Jamie Bullock <jamie at postlude.co.uk> wrote:
> Can't the caller just communicate with Pd by passing messages through the libPd API? I thought the whole point of libPd was that you have your code and Pd's code running in the same process, with a lightweight wrapper in between, so there should be virtually zero latency in passing messages from your code to a running Pd. Certainly it shouldn't require timestamping to de-jitter. Or maybe I'm missing the point of your question...

Yes, that's exactly correct. Honestly, what prompted this for me was a
great deal simpler -- I was annoyed at the inability to process lists
with qlist and textfile directly. ;) So, if I have my code logic
calculating the sequence of events and then passing those into Pd as
messages, I'd be inclined to do so through a list; I was just having
to break up that list and add a bunch of 'set' commands at the
beginning, and it makes for extra logic in the patch that looked ugly.
Usually when that happens, I try to double-check that I'm not missing
something.

Frank wrote --
> Actually I think, Pd is great for scheduling (musical) events, so I'd not put that into the interface code. The Pd side is probably, where the musicians and composers work and they are the ones who need to deal with sequences, timing,
rhythms etc.

And yeah, Frank, I agree with your points about syncing GUI / app time
to Pd's clock. That's actually probably unnecessary for most
applications, but for those in which you do need to verify precisely
when an event happened (a game).

I meant only that I was moving the sequencing *logic* outside Pd,
which allows the use of Pd to be more generic. Then you let Pd simply
be the event scheduler, and your UI and app logic do the work of
deciding the sequence, but not the clock-specific scheduling of any of
the events in that sequence. And hence I'm passing off lists back to
Pd (not huge lists, but nonetheless)

I think this conversation largely answers my questions. The difference
between what I've been doing and what the Rj scene player we have
included with libpd does was that I didn't necessarily want to patch
the Pd sequencing logic, but instead leave that as generic as possible
in order to allow myself (and others) to try out ideas in their code,
in Java or C++ or whatever.

Peter



More information about the Pd-list mailing list