<meta http-equiv="content-type" content="text/html; charset=utf-8"><div>Greetings All</div><div><br></div><div>I&#39;m having trouble getting my external to work, It compiles with 5 warnings</div><div>sineq.c:48: warning: unused variable ‘x’</div>

<div>sineq.c:49: warning: unused variable ‘in1’</div><div>sineq.c:50: warning: unused variable ‘in2’</div><div>sineq.c:51: warning: unused variable ‘in3’</div><div>sineq.c:52: warning: unused variable ‘in4’</div><div><br>

</div><div>It does a &quot;make&quot; successfully but I get this warning message </div><div>/usr/bin/ld: warning: cannot find entry symbol xport_dynamic; defaulting to 00000000000007f0</div><div><br></div><div>but when I try and add it in PD it says &quot;couldn&#39;t create&quot;.  I&#39;ve looked at the pan~ tutorial and the d_osc.c file as recommended, which did help.  I tried to take pieces from the two which I thought were applicable to my situation but I&#39;m still having some issues.</div>

<div><br></div><div>Here&#39;s a link to the workflow (dropbox)</div><div><a href="http://dl.dropbox.com/u/6576402/questions/pd/Sine_EQ_Diagram.jpg">http://dl.dropbox.com/u/6576402/questions/pd/Sine_EQ_Diagram.jpg</a></div>

<div><br></div><div>Here&#39;s a link to the C code online (pastebin)</div><div><a href="http://pastebin.com/9rK3szUE">http://pastebin.com/9rK3szUE</a></div><div><br></div><div><br></div><div>My external is a reproduction of the sinewave equation with 4 inputs and one output my logic is to have 4 inlets one for the frequency,amplitude,phase and vertical offset and an output for the created signal.  Granted this isn&#39;t the final equation but this will help me understand how to create the full equation once done.   If you want to see the full equation I&#39;ll be using here&#39;s a link to it below.  Basically it&#39;s a 1 second periodic signal with the sample rate at 44100 which the equation gives me control over the frequency,amplitude,phase and vertical offset, which will be controlled by a usb midi controller.</div>

<div><br></div><div>Another question I have is what do I use for the t (time) for my final equation is that the t_sample object in PD?  or do I need to create a for loop counting from 1-44100 for a 1 second 44100 sampled equation?</div>

<div><br></div><div><a href="http://dl.dropbox.com/u/6576402/questions/eq1.txt" target="_blank">http://dl.dropbox.com/u/6576402/questions/eq1.txt</a></div><div><div><br></div><div><div>PS: I&#39;m compiling on ubuntu 10.04 using gcc</div>

</div></div><br><div class="gmail_quote">On Sun, Sep 4, 2011 at 12:13 PM, Martin Peach <span dir="ltr">&lt;<a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

On 2011-09-04 16:52, Rick T wrote:<br>
...<div class="im"><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
I&#39;ve been able to find instructions on how to create a hello world<br>
C-external but not one that creates a simple sine wave from a sinewave<br>
equation like A*sin(w*t+p)<br>
(<a href="https://secure.wikimedia.org/wikipedia/en/wiki/Sine_wave" target="_blank">https://secure.wikimedia.org/<u></u>wikipedia/en/wiki/Sine_wave</a>) Does anyone<br>
have one or know where to find one.<br>
</blockquote>
<br></div>
The canonical reference is here:<br>
<a href="http://iem.at/pd/externals-HOWTO/node6.html" target="_blank">http://iem.at/pd/externals-<u></u>HOWTO/node6.html</a><br>
You just need to plug your equation into the perform routine.<br>
Also check the source for osc~ in d_osc.c of the Pd source, which uses a fancy 32-bit float cosine table scanning method that was useful when it mattered but is getting obsolete as a call to sin() is probably just as fast nowadays.<br>

<font color="#888888">
<br>
Martin<br>
</font></blockquote></div><br><br clear="all"><div><br></div><br>