[PD] external object becoming a message box after saving

Hans-Christoph Steiner hans at eds.org
Wed Jan 10 06:43:44 CET 2007


Strange, this is happening with the cyclone/toxy objects too.  I  
wonder what's causing it...

.hc

On Jan 9, 2007, at 2:50 PM, ugur guney wrote:

> # Hi list!
> # I'm trying to learn how to write externals (after being able to  
> link and compile the source codes thanks to Yvan Vander Sanden's  
> tutorial) and come up with a strange behavoir: The object  
> [additive~] turns into a messege box [additive~( (and sometimes its  
> borders are totally erased or sometimes pd crashes) after saving  
> the patch (but not everytime). Maybe I made a mistake that I  
> couldn't find. What might be the reason of such an error?
> # Here is the code I've written. The object should be post the  
> number of incoming bangs and the time after creation (when dsp is  
> on) and compiled .dll file is attached.
> -ugur-
>
> #include "m_pd.h"
>
> static t_class *additive_tilde_class;
>
> typedef struct _additive_tilde {
>   t_object x_obj;
>
>   t_int bangtime;
>   t_float time;
> } t_additive_tilde;
>
> void additive_tilde_bang(t_additive_tilde *x)
> {
>   post("you banged %d times. time: %f", x->bangtime++, x->time);
> }
>
> t_int *additive_tilde_perform(t_int *w)
> {
>   t_additive_tilde *x = (t_additive_tilde *)(w[1]);
>   t_sample       *out =         (t_sample *)(w[2]);
>   int               n =                (int)(w[3]);
>
>   while (n--)
>   {
>     *out++ = x->time;
>     x->time += 1.0f/44100;
>   }
>
>   return (w+4);
> }
>
> void additive_tilde_dsp(t_additive_tilde *x, t_signal **sp)
> {
>   dsp_add(additive_tilde_perform, 3, x,
>           sp[0]->s_vec, sp[0]->s_n);
> }
>
> void *additive_tilde_new(t_floatarg f)
> {
>   t_additive_tilde *x = (t_additive_tilde *)pd_new 
> (additive_tilde_class);
>   x->time = f;
>   x->bangtime =  0;
>   outlet_new(&x->x_obj, gensym("signal"));
>
>   return (void *)x;
> }
>
> __declspec (dllexport) void additive_tilde_setup(void)
> {
>   additive_tilde_class = class_new(gensym("additive~"),
>         (t_newmethod)additive_tilde_new,
>         0, sizeof(t_additive_tilde),
>         CLASS_DEFAULT,
>         A_DEFFLOAT, 0);
>
>   class_addmethod(additive_tilde_class,
>         (t_method)additive_tilde_dsp, gensym("dsp"), 0);
>
>   class_addbang(additive_tilde_class, additive_tilde_bang);
> }
> <additive~.dll>
> _______________________________________________
> PD-list at iem.at mailing list
> UNSUBSCRIBE and account-management -> http://lists.puredata.info/ 
> listinfo/pd-list


------------------------------------------------------------------------

As we enjoy great advantages from inventions of others, we should be  
glad of an opportunity to serve others by any invention of ours; and  
this we should do freely and generously.         - Benjamin Franklin


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20070110/38f9caf0/attachment.htm>


More information about the Pd-list mailing list