<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 2:46 PM, Patrice Colet <span dir="ltr">&lt;<a href="mailto:colet.patrice@free.fr">colet.patrice@free.fr</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

Hello, I&#39;m not a C expert but I see errors in your code<br>
<br>
----- &quot;Rick T&quot; &lt;<a href="mailto:ratulloch@gmail.com">ratulloch@gmail.com</a>&gt; a écrit :<br>
<div class="im"><br>
&gt; Greetings All<br>
&gt;<br>
&gt;<br>
&gt; I&#39;m having trouble getting my external to work, It compiles with 5<br>
&gt; warnings<br>
&gt; sineq.c:48: warning: unused variable ‘x’<br>
&gt; sineq.c:49: warning: unused variable ‘in1’<br>
&gt; sineq.c:50: warning: unused variable ‘in2’<br>
&gt; sineq.c:51: warning: unused variable ‘in3’<br>
&gt; sineq.c:52: warning: unused variable ‘in4’<br>
&gt;<br>
<br>
</div>in <a href="http://iem.at/pd/externals-HOWTO/node6.html" target="_blank">http://iem.at/pd/externals-HOWTO/node6.html</a> it&#39;s not a t_float but a t_sample for using those variables<br>
<div class="im"><br></div></blockquote><div>True but the variables in my external are floats not samples like in the example pan~ which takes in 2 different signals.  I&#39;m taking in 4 different floats (numbers)</div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">

<div class="im">
<br>
&gt;<br>
&gt; It does a &quot;make&quot; successfully but I get this warning message<br>
&gt; /usr/bin/ld: warning: cannot find entry symbol xport_dynamic;<br>
&gt; defaulting to 00000000000007f0<br>
&gt;<br>
<br>
</div>it&#39;s certainly caused by your makefile during linking, it&#39;s rather export_dynamic, you&#39;ve certainly made a typo ^^<br></blockquote><div><br></div><div>I thought so to but when I take a look at the make file it looks fine</div>

<div>here&#39;s a link to the code in (pastebin)</div><div><br></div><div><meta http-equiv="content-type" content="text/html; charset=utf-8"><a href="http://pastebin.com/n6DZivyY">http://pastebin.com/n6DZivyY</a></div><div>

<br></div><div><br></div><div><div># Makefile</div><div># (c) 2006 IOhannes m zmölnig</div><div><br></div><div># path to pd</div><div>## change this according to your setup!</div><div>PDROOT=../../../../pd</div><div>#PDROOT=/home/zmoelnig/src/pd/</div>

<div><br></div><div># here we find the sources of pd (and evtl. the pd.lib)</div><div>PDSRCDIR=$(PDROOT)/src</div><div>PDLIBDIR=$(PDROOT)/bin</div><div><br></div><div># this is the filename-extension</div><div># people have to specify it at the cmdline: eg &quot;make pd_linux&quot;</div>

<div>EXTENSION=$(MAKECMDGOALS)</div><div><br></div><div># if no filename-extension is supplied by the user</div><div># try to guess one, based on what &quot;uname&quot; tells us</div><div>UNAME := $(shell uname -s)</div>
<div>
ifeq ($(UNAME),Linux)</div><div>  DEFAULTEXTENSION= pd_linux</div><div>else</div><div>  ifeq ($(UNAME),Darwin)</div><div>    DEFAULTEXTENSION= pd_darwin</div><div>  else</div><div>    ifeq (MINGW,$(findstring MINGW,$(UNAME)))</div>

<div>      DEFAULTEXTENSION= pd_nt</div><div>    else</div><div>      ifeq ($(UNAME),IRIX)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>UNAMEV := $(shell uname -R)</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>ifeq (6.,$(findstring 6.,$(UNAMEV)))</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>  DEFAULTEXTENSION= pd_irix6</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>else</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>  DEFAULTEXTENSION= pd_irix5</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>endif</div><div>      else</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>DEFAULTEXTENSION=help</div><div>      endif</div><div>    endif</div>

<div>  endif</div><div>endif</div><div><br></div><div># if no extension is given, call &quot;make&quot; again with a guessed extension</div><div>auto:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>make $(DEFAULTEXTENSION)</div>

<div><br></div><div># just a stupid fallback</div><div>help: </div><div><span class="Apple-tab-span" style="white-space:pre">        </span>@echo &quot;choose one command:  make pd_linux (linux), make pd_darwin (osX), make pd_irix5 (IRIX5), make pd_irix6 (IRIX6), make dll (MSVC), make pd_nt (MinWG)&quot;</div>

<div><br></div><div># delete old build files</div><div>clean:</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-rm -f *.dll *.pd_* *.o *.obj *~</div><div><br></div><div># we want to compile all C-files we find in the current directory</div>

<div>SOURCES=$(sort $(filter %.c, $(wildcard *.c)))</div><div># each C-files maps will become an external with the given filename-extension</div><div>TARGETS=$(SOURCES:.c=.$(EXTENSION))</div><div><br></div><div><br></div>

<div># ----------------------- Linux -----------------------</div><div><br></div><div>pd_linux: $(TARGETS)</div><div><br></div><div>LINUXCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer -fPIC \</div><div>    -Wall -W -Wshadow -Wstrict-prototypes -Werror \</div>

<div>    -Wno-unused -Wno-parentheses -Wno-switch</div><div><br></div><div>LINUXLDFLAGS =  -export_dynamic -shared  -lc -lm</div><div><br></div><div>LINUXINCLUDE =  -I$(PDSRCDIR)</div><div><br></div><div>%.pd_linux: %.c</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CC) $(LINUXLDFLAGS) $(LINUXCFLAGS) $(LINUXINCLUDE) -o $*.pd_linux $*.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>strip --strip-unneeded $*.pd_linux</div>

<div><br></div><div><br></div><div><br></div><div># ----------------------- Mac OSX -----------------------</div><div><br></div><div>pd_darwin: $(TARGETS)</div><div><br></div><div>DARWINCFLAGS = -DPD -O2 -Wall -W -Wshadow -Wstrict-prototypes \</div>

<div>    -Wno-unused -Wno-parentheses -Wno-switch</div><div><br></div><div>DARWININCLUDE = -I$(PDSRCDIR)</div><div><br></div><div>DARWINLDFLAGS = -bundle -undefined suppress -flat_namespace</div><div><br></div><div>%.pd_darwin: %.c</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CC) $(DARWINCFLAGS) $(DARWININCLUDE) $(DARWINLDFLAGS) -o $*.pd_darwin $*.c</div><div><br></div><div><br></div><div># ----------------------- IRIX 5.x -----------------------</div>

<div>pd_irix5: $(TARGETS)</div><div><br></div><div>SGICFLAGS5 = -o32 -DPD -DSGI -O2</div><div><br></div><div>SGIINCLUDE =  -I$(PDSRCDIR)</div><div><br></div><div>SGILDFLAGS =  -elf -shared -rdata_shared</div><div><br></div>

<div>%.pd_irix5: %.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CC) $(SGICFLAGS5) $(SGIINCLUDE) -o $*.o -c $*.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(LD) $(SGILDFLAGS) -o $*.pd_irix5 $*.o</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>rm $*.o</div><div><br></div><div><br></div><div># ----------------------- IRIX 6.x -----------------------</div><div>pd_irix6: $(TARGETS)</div><div><br></div>

<div>SGICFLAGS6 = -DPD -DSGI -n32 \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -OPT:cray_ivdep=true \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>-Ofast=ip32</div>

<div><br></div><div>%.pd_irix6: %.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CC) $(SGICFLAGS6) $(SGIINCLUDE) -o $*.o -c $*.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(LD) $(SGILDFLAGS) -o $*.pd_irix6 $*.o</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>rm $*.o</div><div><br></div><div><br></div><div># ----------------------- NT -----------------------</div><div>dll: $(TARGETS)</div><div><br></div><div>PDNTCFLAGS = /W3 /WX /DPD /DNT /D__WIN32__ /DMSW /nologo</div>

<div><br></div><div>VC=&quot;C:\Programme\Microsoft Visual Studio\Vc98&quot;</div><div><br></div><div>PDNTINCLUDE = /I. /I$(PDROOT)\tcl\include /I$(PDSRCDIR)\src /I$(VC)\include</div><div><br></div><div>PDNTLDIR = $(VC)\lib</div>

<div><br></div><div>PDNTLIB = $(PDNTLDIR)\libc.lib \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(PDNTLDIR)\oldnames.lib \</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(PDNTLDIR)\kernel32.lib \</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>$(PDLIBDIR)\pd.lib </div><div><br></div><div>%.dll: %.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>cl $(PDNTCFLAGS) $(PDNTINCLUDE) /c $*.c</div>

<div><span class="Apple-tab-span" style="white-space:pre">        </span>link /dll /export:$*_setup $*.obj $(PDNTLIB)</div><div><br></div><div><br></div><div>pd_nt: $(TARGETS)</div><div><br></div><div>MINGWCFLAGS = -DPD -O2 -funroll-loops -fomit-frame-pointer \</div>

<div>    -Wall -W -Wshadow -Wstrict-prototypes -Werror \</div><div>    -Wno-unused -Wno-parentheses -Wno-switch -mms-bitfields</div><div><br></div><div>MINGWLDFLAGS =  -export_dynamic -shared -lm -lkernel32 -lcoldname -lcrtdll -lpd -L$(PDLIBDIR)</div>

<div><br></div><div>MINGWINCLUDE =  -I$(PDSRCDIR)</div><div><br></div><div>%.pd_nt: %.c</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>$(CC) $(MINGWLDFLAGS) $(MINGWCFLAGS) $(MINGWINCLUDE) -o $*.dll $*.c</div>

</div><div><br></div><div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im"><br>
&gt;<br>
&gt; but when I try and add it in PD it says &quot;couldn&#39;t create&quot;. I&#39;ve looked<br>
&gt; at the pan~ tutorial and the d_osc.c file as recommended, which did<br>
&gt; help. I tried to take pieces from the two which I thought were<br>
&gt; applicable to my situation but I&#39;m still having some issues.<br>
&gt;<br>
<br>
</div>maybe a little look into bassmu~ source code could also be interesting<br></blockquote><div><br></div><div>Do you know the name for the source file or know where I can find it?  I typed in bassmu~</div><div>in PD and nothing came back.</div>

<div><br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div><div></div><div class="h5"><br>
&gt;<br>
&gt; Here&#39;s a link to the workflow (dropbox)<br>
&gt; <a href="http://dl.dropbox.com/u/6576402/questions/pd/Sine_EQ_Diagram.jpg" target="_blank">http://dl.dropbox.com/u/6576402/questions/pd/Sine_EQ_Diagram.jpg</a><br>
&gt;<br>
&gt;<br>
&gt; Here&#39;s a link to the C code online (pastebin)<br>
&gt; <a href="http://pastebin.com/9rK3szUE" target="_blank">http://pastebin.com/9rK3szUE</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; My external is a reproduction of the sinewave equation with 4 inputs<br>
&gt; and one output my logic is to have 4 inlets one for the<br>
&gt; frequency,amplitude,phase and vertical offset and an output for the<br>
&gt; created signal. Granted this isn&#39;t the final equation but this will<br>
&gt; help me understand how to create the full equation once done. If you<br>
&gt; want to see the full equation I&#39;ll be using here&#39;s a link to it below.<br>
&gt; Basically it&#39;s a 1 second periodic signal with the sample rate at<br>
&gt; 44100 which the equation gives me control over the<br>
&gt; frequency,amplitude,phase and vertical offset, which will be<br>
&gt; controlled by a usb midi controller.<br>
&gt;<br>
&gt;<br>
&gt; Another question I have is what do I use for the t (time) for my final<br>
&gt; equation is that the t_sample object in PD? or do I need to create a<br>
&gt; for loop counting from 1-44100 for a 1 second 44100 sampled equation?<br>
&gt;<br>
&gt;<br>
&gt; <a href="http://dl.dropbox.com/u/6576402/questions/eq1.txt" target="_blank">http://dl.dropbox.com/u/6576402/questions/eq1.txt</a><br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; PS: I&#39;m compiling on ubuntu 10.04 using gcc<br>
&gt;<br>
&gt; On Sun, Sep 4, 2011 at 12:13 PM, Martin Peach &lt;<br>
&gt; <a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a> &gt; wrote:<br>
&gt;<br>
&gt;<br>
&gt; On 2011-09-04 16:52, Rick T wrote:<br>
&gt; ...<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; I&#39;ve been able to find instructions on how to create a hello world<br>
&gt; C-external but not one that creates a simple sine wave from a sinewave<br>
&gt; equation like A*sin(w*t+p)<br>
&gt; ( <a href="https://secure.wikimedia.org/" target="_blank">https://secure.wikimedia.org/</a> wikipedia/en/wiki/Sine_wave ) Does<br>
&gt; anyone<br>
&gt; have one or know where to find one.<br>
&gt;<br>
&gt; The canonical reference is here:<br>
&gt; <a href="http://iem.at/pd/externals-" target="_blank">http://iem.at/pd/externals-</a> HOWTO/node6.html<br>
&gt; You just need to plug your equation into the perform routine.<br>
&gt; Also check the source for osc~ in d_osc.c of the Pd source, which uses<br>
&gt; a fancy 32-bit float cosine table scanning method that was useful when<br>
&gt; it mattered but is getting obsolete as a call to sin() is probably<br>
&gt; just as fast nowadays.<br>
&gt;<br>
&gt; Martin<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Pd-dev mailing list<br>
&gt; <a href="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br>
&gt; <a href="http://lists.puredata.info/listinfo/pd-dev" target="_blank">http://lists.puredata.info/listinfo/pd-dev</a><br>
<br>
--<br>
<font color="#888888">Patrice Colet<br>
</font></blockquote></div><br><br clear="all"><div>Aloha</div><div>and thanks for the help every bit helps</div>-- <br><br>