right now i'm converting my convolution external to take as many inputs as the user would like. i'd like to call it like this:
multiconvo~ <number of sources>
is there a way to do this? here is the current code i gotta play with:
static void convaudio2_tilde_dsp(t_convaudio2_tilde *x, t_signal **sp) { dsp_add(convaudio2_tilde_perform, 6, x, sp[0]->s_vec, sp[1]->s_vec, sp[2]->s_vec, sp[3]->s_vec, sp[0]->s_n); }
static void convaudio2_first(t_convaudio2_tilde *x, t_floatarg f) { x->firstfloat = f; }
static void convaudio2_bound(t_convaudio2_tilde *x, t_floatarg f) { x->secondfloat = f; }
static void *convaudio2_tilde_new(t_floatarg f) { t_convaudio2_tilde *x = (t_convaudio2_tilde *)pd_new(convaudio2_tilde_class);
x->f_convaudio2 = f;
//additional signal and float inlets inlet_new(&x->x_obj, &x->x_obj.ob_pd, &s_signal, &s_signal); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("first")); inlet_new(&x->x_obj, &x->x_obj.ob_pd, gensym("float"), gensym("bound"));
//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 convaudio2_tilde_setup(void) { convaudio2_tilde_class = class_new(gensym("convaudio2~"), (t_newmethod)convaudio2_tilde_new, 0, sizeof(t_convaudio2_tilde), CLASS_DEFAULT, A_DEFFLOAT, 0);
class_addmethod(convaudio2_tilde_class, (t_method)convaudio2_tilde_dsp, gensym("dsp"), 0); class_addmethod(convaudio2_tilde_class, (t_method)convaudio2_first, gensym("first"), A_FLOAT, 0); class_addmethod(convaudio2_tilde_class, (t_method)convaudio2_bound, gensym("bound"), A_FLOAT, 0); CLASS_MAINSIGNALIN(convaudio2_tilde_class, t_convaudio2_tilde, f);
"640K ought to be enough for anybody." -- Bill Gates, 1981
J. Scott Hildebrand wrote:
right now i'm converting my convolution external to take as many inputs as the user would like. i'd like to call it like this:
multiconvo~ <number of sources>
is there a way to do this? here is the current code i gotta play with:
Have a look at maxlib at http://www.akustische-kunst.org/puredata/maxlib/ . The example is from "multi"
for(i = 2; i < argc; i++) /* create additional inlets, if any */ { floatinlet_new(&x->x_ob, &x->x_multivalue[i]); }
This creates at least 2 inputs using the number of arguments to create inputs. You could easily change this to be the value (argv) instead.
By the way, have you considered the user position and orientation in your engine or do you modify the sound coordinates before they are fed to the convolver?
Cheers Soeren
thanks soeren,
right now i'm disregarding orientation. also disregarding position
because all i can do at this point is attenuate the volume as a sound gets farther away. there are actually user controls to place the sound based on azimuth and elevation. once i finish the multi-source convolution i'll add a headtracker, and then get to room models.
scott
On Wed, 6 Aug 2003, Søren Bovbjerg wrote:
J. Scott Hildebrand wrote:
right now i'm converting my convolution external to take as many inputs as the user would like. i'd like to call it like this:
multiconvo~ <number of sources>
is there a way to do this? here is the current code i gotta play with:
Have a look at maxlib at http://www.akustische-kunst.org/puredata/maxlib/ . The example is from "multi"
for(i = 2; i < argc; i++) /* create additional inlets, if any */ { floatinlet_new(&x->x_ob, &x->x_multivalue[i]); }
This creates at least 2 inputs using the number of arguments to create inputs. You could easily change this to be the value (argv) instead.
By the way, have you considered the user position and orientation in your engine or do you modify the sound coordinates before they are fed to the convolver?
Cheers Soeren
PD-list mailing list PD-list@iem.at http://iem.at/cgi-bin/mailman/listinfo/pd-list
"640K ought to be enough for anybody." -- Bill Gates, 1981