Zitiere thewade pdman@aproximation.org:
probably you should have a look at objects that provide a similar I/O-interface like yours and copy'n'paste from that.
one remark: mixing dsp and message inlets is no problem, but you clearly haven't got the concept behind it ;-) your dsp_add() should definitely look like dsp_add(fftbin_tilde_perform, 3, ref, sp[0]->s_vec, sp[0]->s_n); this is: if you want to generate a message-output from one signal input and one message-input. you normally don't pass data from the control-inlet to the perform-routine via a separate argument to the dsp_add but rather it is part of the object's structure ("ref").
furthermore: if you only want to get the n'th element of the signal-vector there are probably other ways (without a need for your own external): e.g: plain pd: [tabsend~] plus [tabread] with zexy: [unpack~] plus [packel] with others i don't know, but i believe there are solutions like stars in the sky.
but of course there is some charme in having written your own external...
mfg.a.dr IOhannes