[PD-dev] Receive from Pd into tcl plugin
Hans-Christoph Steiner
hans at at.or.at
Tue Apr 12 18:28:18 CEST 2011
(I cc'ed pd-dev since I think this is a topic of general interest).
Yes, that's how it would have to happen, as far as I know. The idea
is to have a simple way to get the messages on the pd-gui side,
something like pd_bind. To start with, I think just having a single
receiver 'pd-gui' setup, then plugins would use something like [pd-gui
mousecursor target(, and whatever proc was registered to receive the
'mousecursor' messages would be called. I think a real simple
implementation would be to just make a ::pd-gui:: namespace, then
people would create procs in ::pd-gui:: to receive messages. So like:
proc ::pd-gui::mousecursor {args} {
$tkcanvas configure -cursor [lindex $args 0]
}
And the pd-gui receiver would just strip the 'pd-gui' part and exec
the rest.
.hc
On Apr 12, 2011, at 2:06 AM, Chris McCormick wrote:
> Hi Hans,
>
> I am curious, would it be possible to bind a function in Pd to catch
> all
> messages and send them through to a tcl/tk proc? Not that I want to
> do this, I
> am just curious. It might be best to set up a callback style
> arrangement where
> inside the tcl/tk plugin the developer can make a call specifying
> which receive
> symbol(s) they would like to listen for. That would make things
> pretty flexible
> and allow multiple plugins to use the functionality too.
>
> Cheers,
>
> Chris.
>
> On Tue, Mar 29, 2011 at 02:21:06PM -0400, Hans-Christoph Steiner
> wrote:
>>
>> The easiest way is to create a proc in `pd-gui`, then bind a
>> function in
>> `pd` to a receive symbol, then have that function call the proc
>> using
>> sys_vgui(). I've been thinking that we should have a pre-registered
>> 'pd-gui' receive symbol which will automatically get set to `pd-gui`,
>> just like the 'pd' receive symbol gets sent to `pd`, but I've never
>> found
>> the time. Please beat me to it! :-D
>>
>> .hc
>>
>> On Mar 29, 2011, at 2:46 AM, Chris McCormick wrote:
>>
>>> Hi Hans,
>>>
>>> Is there any way to use the pd_connect tcl in the same way that it
>>> does pdsend
>>> to receive data back from Pd? I am persuing a bit of a hack of an
>>> idea.
>>>
>>> Cheers,
>>>
>>> Chris.
>>>
>>> -------------------
>>> http://mccormick.cx
>>
>>
>>
>> ----------------------------------------------------------------------------
>>
>> "Making boring techno music is really easy with modern tools, but
>> with
>> live coding, boring techno is much harder." - Chris McCormick
>>
>>
>>
>>
>
> -------------------
> http://mccormick.cx
----------------------------------------------------------------------------
I have always wished for my computer to be as easy to use as my
telephone; my wish has come true because I can no longer figure out
how to use my telephone." --Bjarne Stroustrup (creator of C++)
More information about the Pd-dev
mailing list