<div dir="ltr"><br><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, May 26, 2014 at 11:28 AM, IOhannes m zmoelnig <span dir="ltr"><<a href="mailto:zmoelnig@iem.at" target="_blank">zmoelnig@iem.at</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">-----BEGIN PGP SIGNED MESSAGE-----<br>
Hash: SHA256<br>
<div class=""><br>
On 2014-05-26 09:35, Alexandros Drymonitis wrote:<br>
>> void *tabPowSine_new(t_symbol *s, short argc, t_atom *argv)<br>
<br>
</div>short argc? why short?<br>
<br>
this *must* be int (32bit!).<br></blockquote><div>It was shown this way in Lyon's book, no idea why, or what it should be. Tried with an int though and it still won't work. Is it in the setup function or the perform routine? I've read that Pd cannot know whether an object's inlet has been connected to another object, so how can I use variables which have their values set by creation arguments, instead of vectors arriving at the object's inlets?<br>
<br></div><div>My perform routine starts as follows:<br>t_int *powSine_perform(t_int *w)<br>{<br>        // Copy the object pointer<br>        t_powSine *x = (t_powSine *) (w[1]);<br><br>        // Copy signal vector pointers<br>
        t_float *frequency = (t_float *) (w[2]);<br>        t_float *phase_mod = (t_float *) (w[3]);<br>        t_float *power = (t_float *) (w[4]);<br>        t_float *out = (t_float *) (w[5]);<br><br>        // Copy the signal vector size<br>
        t_int n = w[6];<br><br></div><div>And then I set some local variables and run the while loop for each sample. The while loop is using *frequency and *power for its calculations. Since Pd cannot know if the object is connected to another object, how can I use x->x_frequency and x->x_power (variables declared in the object structure) instead of *frequency and *power, until I start sending signals (or floats) to the respective inlets? A few emails further up in this thread I've posted the setup function as well, I'm posting it again:<br>
void powSine_tilde_setup(void)<br>{<br>        // Initialize the class<br>        powSine_class = class_new(gensym("powSine~"), (t_newmethod)powSine_new, 0, sizeof(t_powSine), 0, A_GIMME, 0);<br><br>        // Specify signal input, with automatic float to signal conversion<br>
        CLASS_MAINSIGNALIN(powSine_class, t_powSine, x_f);<br><br>        // Bind the DSP method, which is called when the DACs are turned on<br>        class_addmethod(powSine_class, (t_method)powSine_dsp, gensym("dsp"), A_CANT, 0);<br>
<br>        // Bind the method to receive a float in the last inlet (control) to reset the phase<br>        class_addmethod(powSine_class, (t_method)powSine_ft1, gensym("ft1"), A_FLOAT, 0);<br><br>        // Print authorship to Pd window<br>
        post("powSine~: Sinewave oscillator raised to a power\n external by Alexandros Drymonitis");<br>}<br></div><div>I've added a control inlet to set the oscillator's phase which is working fine (I've kind of copied the code from [phasor~]'s code). That wasn't included in the previous email.<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<br>
<br>
fgamsdr<br>
IOhannes<br>
-----BEGIN PGP SIGNATURE-----<br>
Version: GnuPG v1<br>
Comment: Using GnuPG with Icedove - <a href="http://www.enigmail.net/" target="_blank">http://www.enigmail.net/</a><br>
<br>
iQIcBAEBCAAGBQJTgvsuAAoJELZQGcR/ejb4wHcP/jFL24R1nT6lh46fw04EycEw<br>
DDLP8vsElpyYkJ73cT9s5cjP+in9CayqxMB/GzMst0jOKByibSvrO8oRm7WmEdo8<br>
7tWaF+ZClvAO8ksAbe8P4Ir9DxHH7lHMYhJJxfebgbUY9UFAcDUTqCFfEjUQYC64<br>
Mb8P0a/duI9vXwmbVhAbx+DRFjh4qY60t+Jhan3EYlQBmi25Z1QnzzJdEHje0N2K<br>
fIqSArkOau4xKeah6hKPTcYukh/BTHGOtX8Zq1aEfmWjwhEYBmwpkaAwdY4dsAts<br>
9TZIrmG+HGQKSusJN1cAPWb8WubwFzwh6VO4QGcaaf6ftmE6FLM0B0mimhnLkni3<br>
lyT9pKNKl6zRDc85DY90PpCnuvQJlGTG5PYi698lC102rJsgHXz4pghCdK/X3v22<br>
UjBPvGXUx4ScnFl1+6rwmnzS5Xdr8Aw54xFa+1D8E1UtANwNovi9C4KEP/XKPRri<br>
s+EIKnKuTMsc4+tUsuQdysm2SIZDvOxIsm3eI0+mEeu6g4KZZC8Bb+T7sA8BSZLp<br>
FpOo/5wEuI6RzvmKj5Syx5TRwfol4XzVBRYfyf15lmgi+IiXy3PAtTi7dPtBSGlL<br>
FGCSOxTrpoBWsieSEC7EXgKvQCC5o80QfBnxXmoJoeG7OjP7OF+fsfrZ+0GiDVeh<br>
j16bDOwyuxmgMYT28ld2<br>
=Ag7/<br>
-----END PGP SIGNATURE-----<br>
<div class=""><div class="h5"><br>
_______________________________________________<br>
<a href="mailto:Pd-list@lists.iem.at">Pd-list@lists.iem.at</a> mailing list<br>
UNSUBSCRIBE and account-management -> <a href="http://lists.puredata.info/listinfo/pd-list" target="_blank">http://lists.puredata.info/listinfo/pd-list</a><br>
</div></div></blockquote></div><br></div></div>