<br><br><div class="gmail_quote">On Fri, Sep 9, 2011 at 2:46 PM, Patrice Colet <span dir="ltr"><<a href="mailto:colet.patrice@free.fr">colet.patrice@free.fr</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
Hello, I'm not a C expert but I see errors in your code<br>
<br>
----- "Rick T" <<a href="mailto:ratulloch@gmail.com">ratulloch@gmail.com</a>> a écrit :<br>
<div class="im"><br>
> Greetings All<br>
><br>
><br>
> I'm having trouble getting my external to work, It compiles with 5<br>
> warnings<br>
> sineq.c:48: warning: unused variable ‘x’<br>
> sineq.c:49: warning: unused variable ‘in1’<br>
> sineq.c:50: warning: unused variable ‘in2’<br>
> sineq.c:51: warning: unused variable ‘in3’<br>
> sineq.c:52: warning: unused variable ‘in4’<br>
><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'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'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>
><br>
> It does a "make" successfully but I get this warning message<br>
> /usr/bin/ld: warning: cannot find entry symbol xport_dynamic;<br>
> defaulting to 00000000000007f0<br>
><br>
<br>
</div>it's certainly caused by your makefile during linking, it's rather export_dynamic, you'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'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 "make pd_linux"</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 "uname" 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 "make" 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 "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)"</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="C:\Programme\Microsoft Visual Studio\Vc98"</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>
><br>
> but when I try and add it in PD it says "couldn't create". I've looked<br>
> at the pan~ tutorial and the d_osc.c file as recommended, which did<br>
> help. I tried to take pieces from the two which I thought were<br>
> applicable to my situation but I'm still having some issues.<br>
><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>
><br>
> Here's a link to the workflow (dropbox)<br>
> <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>
><br>
><br>
> Here's a link to the C code online (pastebin)<br>
> <a href="http://pastebin.com/9rK3szUE" target="_blank">http://pastebin.com/9rK3szUE</a><br>
><br>
><br>
><br>
><br>
> My external is a reproduction of the sinewave equation with 4 inputs<br>
> and one output my logic is to have 4 inlets one for the<br>
> frequency,amplitude,phase and vertical offset and an output for the<br>
> created signal. Granted this isn't the final equation but this will<br>
> help me understand how to create the full equation once done. If you<br>
> want to see the full equation I'll be using here's a link to it below.<br>
> Basically it's a 1 second periodic signal with the sample rate at<br>
> 44100 which the equation gives me control over the<br>
> frequency,amplitude,phase and vertical offset, which will be<br>
> controlled by a usb midi controller.<br>
><br>
><br>
> Another question I have is what do I use for the t (time) for my final<br>
> equation is that the t_sample object in PD? or do I need to create a<br>
> for loop counting from 1-44100 for a 1 second 44100 sampled equation?<br>
><br>
><br>
> <a href="http://dl.dropbox.com/u/6576402/questions/eq1.txt" target="_blank">http://dl.dropbox.com/u/6576402/questions/eq1.txt</a><br>
><br>
><br>
><br>
><br>
> PS: I'm compiling on ubuntu 10.04 using gcc<br>
><br>
> On Sun, Sep 4, 2011 at 12:13 PM, Martin Peach <<br>
> <a href="mailto:martin.peach@sympatico.ca">martin.peach@sympatico.ca</a> > wrote:<br>
><br>
><br>
> On 2011-09-04 16:52, Rick T wrote:<br>
> ...<br>
><br>
><br>
><br>
><br>
> I'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/" target="_blank">https://secure.wikimedia.org/</a> wikipedia/en/wiki/Sine_wave ) Does<br>
> anyone<br>
> have one or know where to find one.<br>
><br>
> The canonical reference is here:<br>
> <a href="http://iem.at/pd/externals-" target="_blank">http://iem.at/pd/externals-</a> HOWTO/node6.html<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<br>
> a fancy 32-bit float cosine table scanning method that was useful when<br>
> it mattered but is getting obsolete as a call to sin() is probably<br>
> just as fast nowadays.<br>
><br>
> Martin<br>
><br>
><br>
><br>
><br>
><br>
><br>
</div></div>> _______________________________________________<br>
> Pd-dev mailing list<br>
> <a href="mailto:Pd-dev@iem.at">Pd-dev@iem.at</a><br>
> <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>