[PD] multi-source convolution help (with external details)

J. Scott Hildebrand jshildebrand at ucdavis.edu
Fri Aug 8 21:05:04 CEST 2003

it's been almost a year since i've really been into the external coding,
and right now i'm trying to do something i just don't know how to do.
the first three inlets will always be there and they are select, azimuth,
and elevation. after that is the user specified amount of sources for
which there will be one mono input each. i'll paste that part of the code
here for anybody who's interested in helping me out. thanks!


static void multiconvo_tilde_dsp(t_multiconvo_tilde *x, t_signal **sp)
  dsp_add(multiconvo_tilde_perform, 6, x,
          sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec,

static void multiconvo_select(t_multiconvo_tilde *x, t_floatarg f)
	x->firstfloat = f;

static void multiconvo_azimuth(t_multiconvo_tilde *x, t_floatarg f)
	x->secondfloat = f;

static void multiconvo_elevation(t_multiconvo_tilde *x, t_floatarg f)
	x->thirdfloat = f;

static void *multiconvo_tilde_new(t_floatarg f, t_int argc, t_atom* argv)
  int i;
  t_multiconvo_tilde *x = (t_multiconvo_tilde

  x->f_multiconvo = f;

  //additional signal and float inlets
  inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"),
  inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"),
  inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"),

  for(i = 0; i <= argv[2]; i++)
  inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal);

  //two signal outlets for stereo
  outlet_new(&x->x_obj, &s_signal);
  outlet_new(&x->x_obj, &s_signal);

  return (void *)x;

//setup declares new classes and their properties
void multiconvo_tilde_setup(void) {
  multiconvo_tilde_class = class_new(gensym("multiconvo~"),
        0, sizeof(t_multiconvo_tilde),
        A_DEFFLOAT, 0);

  class_addmethod(multiconvo_tilde_class, (t_method)multiconvo_select,
gensym("select"), A_FLOAT, 0);
  class_addmethod(multiconvo_tilde_class, (t_method)multiconvo_azimuth,
gensym("azimuth"), A_FLOAT, 0);
  class_addmethod(multiconvo_tilde_class, (t_method)multiconvo_elevation,
gensym("elevation"), A_FLOAT, 0);

//  for(int i = 0; i <= argv[2]; i++)
 // {
(t_method)multiconvo_tilde_dsp, gensym("dsp"), 0);

  CLASS_MAINSIGNALIN(multiconvo_tilde_class, t_multiconvo_tilde, f);


	"640K ought to be enough for anybody." -- Bill Gates, 1981


More information about the Pd-list mailing list