[PD-dev] Yet another newbie question...

Julien Jassaud sojastar at wanadoo.fr
Fri Oct 17 00:08:49 CEST 2003


Hi to all,

I'm trying to write an external that outputs text. Basicaly, you send 
it a bang, and it outputs text trough its only outlet. Simple, but I 
can't get it to work. I have two problems. First, when I print what 
gets out of the outlet, the string is always preceded by a "list" (the 
selector, I guess). Is there a way to remove this? Second (and worst), 
it crashes PD. I followed a few examples I found about outlet_list, and 
I don't understand what I'm doing wrong. Here's the code and what the 
error message I get in the terminal. I'm using PD 0.36 on Mac OS X 
10.2.8.

------------------------ CODE:


#include <string.h>
#include <stdio.h>
#include "m_imp.h" /* pd includes */

static t_class *pinball_class;

typedef struct _pinball
{
     t_object x_obj;

     t_outlet *sortie;
} t_pinball;

void pinball_bang(t_pinball *x)
{
     t_atom *bluh;

     SETSYMBOL(bluh, gensym("create"));
     SETSYMBOL(bluh+1, gensym("destroy"));
     outlet_list(x->sortie, &s_list, 2, bluh);
}

void *pinball_new(void)
{
     t_pinball *x = (t_pinball *)pd_new(pinball_class);

     x->sortie = outlet_new(&x->x_obj, &s_list);

     return (void *)x;
}

void pinball_free(t_pinball *x)
{

}

void pinball_setup(void)
{
     pinball_class = class_new(gensym("pinball"), 
(t_newmethod)pinball_new, (t_method)pinball_free, sizeof(t_pinball), 
CLASS_DEFAULT, A_GIMME, 0);

     class_addbang(pinball_class, pinball_bang);

     class_sethelpsymbol(pinball_class, gensym("help-pinball.pd"));
}


------------------------- ERROR MESSAGE:

print: list create destroy
pd_gui: pd process exited
/Applications/Pd.command: line 2:  1639 Bus error               
/usr/local/pd/bin/pd -rt -lib GEM -midiindev 0



Thanks,
Julien


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: text/enriched
Size: 2760 bytes
Desc: not available
URL: <http://lists.puredata.info/pipermail/pd-dev/attachments/20031017/88e93525/attachment.bin>


More information about the Pd-dev mailing list