<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Sun, May 25, 2014 at 10:28 PM, Jonathan Wilkes <span dir="ltr"><<a href="mailto:jancsika@yahoo.com" target="_blank">jancsika@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt">
<div><span>What's your setup routine for the external look like?</span></div></div></div></blockquote><div>void tabPowSine_tilde_setup(void)<br>{<br>        // Initialize the class<br>        tabPowSine_class = class_new(gensym("tabPowSine~"), (t_newmethod)tabPowSine_new, (t_method)tabPowSine_free, sizeof(t_tabPowSine), 0, A_GIMME, 0);<br>
<br>        // Specify signal input, with automatic float to signal conversion<br>        CLASS_MAINSIGNALIN(tabPowSine_class, t_tabPowSine, x_f);<br><br>        // Bind the DSP method, which is called when the DACs are turned on<br>
        class_addmethod(tabPowSine_class, (t_method)tabPowSine_dsp, gensym("dsp"), A_CANT, 0);<br><br>        // Print authorship to Pd window<br>        post("powSine~: Sinewave oscillator raised to a power\n external by Alexandros Drymonitis");<br>
}<br><br></div><div>Lyon's book explaing what A_GIMME does, but not A_CANT. I checked m_pd.h a bit but didn't make much out of it. It is there where the problem lies? <br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div><div style="color:rgb(0,0,0);background-color:rgb(255,255,255);font-family:HelveticaNeue,Helvetica Neue,Helvetica,Arial,Lucida Grande,sans-serif;font-size:12pt"><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-style:normal;background-color:transparent">
<span><br></span></div><div style="color:rgb(0,0,0);font-size:16px;font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-style:normal;background-color:transparent"><span>-Jonathan</span></div>
 <div><br><br></div><div style="display:block"> <div style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:12pt"> <div style="font-family:HelveticaNeue,'Helvetica Neue',Helvetica,Arial,'Lucida Grande',sans-serif;font-size:12pt">
<div><div class="h5"> <div dir="ltr"> <font face="Arial"> On Sunday, May 25, 2014 2:14 PM, Alexandros Drymonitis <<a href="mailto:adrcki@gmail.com" target="_blank">adrcki@gmail.com</a>> wrote:<br> </font> </div>  <br>
<br> </div></div><div><div><div class="h5"><div><div dir="ltr"><div><div><div><div><div><div><div><div><div><div>I'm building an external (my very first one) and it's working as expected, only the arguments I type when I create it are not passed and the variables set to get values from these arguments are set to zero.<br>

<br></div>The new instance routine prototype is this:<br></div>void *tabPowSine_new(t_symbol *s, short argc, t_atom argv)<br><br></div>and in this routine I type the following two lines:<br></div>if(argc >= 1) { x->x_frequency = atom_getfloatarg(0, argc, argv); }<br>

</div>if(argc >= 2) { x->x_power = atom_getfloatarg(1, argc, argv); }<br><br></div>but if I create an object like this [tabPowSine~ 220 0.5], the variables x_frequency and x_power (declared in the object structure) won't get these values. As soon as I send a signal or float to the respective inlet, everything works fine.<br>

</div><div><br></div>Also, I get a warning when I type "make" in the terminal, to make the Pd object, which is:<br>tabPowSine~.c:60:32: warning: unused parameter 's' [-Wunused-parameter]<br><br></div>Can I just ommint the t_symbol *s?<br>

</div>I'm following Eric Lyon's book for writing externals, and he's passing this symbol pointer (it is a symbol pointer, right?) to the new instance routine...<br><br></div>Final question, so that I don't send three different emails, is it preferable to use a table lookup cosine oscillator than using the cos function in the perform routine? Is there significant difference in the CPU consumption?<br>

</div></div><br></div></div>_______________________________________________<br><a>Pd-list@lists.iem.at</a> mailing list<br>UNSUBSCRIBE and account-management -> <a>http://lists.puredata.info/listinfo/pd-list</a><br><br>
<br></div>  </div> </div>  </div> </div></div></blockquote></div><br></div></div>