i'll just copy and paste my short code which does convolution. it's
not in realtime but right now i'm trying to just get it to spit out audio. this is the error i get:
error: dac~: bad vector size error: dac~: bad vector size Segmentation fault
thanks for taking a look and here is my perform function:
t_int *convaudio_tilde_perform(t_int *w) { t_convaudio_tilde *x = (t_convaudio_tilde *)(w[1]); t_float *in1 = (t_float *)(w[2]); t_float *in2 = (t_float *)(w[3]); t_float *out1 = (t_float *)(w[4]); t_float *out2 = (t_float *)(w[5]);
int n = (int)(w[6]);
int i;
t_int set=0; t_int azi; t_int ele; t_int readpos;
while (n--) /* fill up a 256 array */ { aleftout[set] = in1[n]; arightout[set] = in2[n]; set++; }//endwhile
azi = (x->firstfloat - 1);
ele = (x->secondfloat - 1);
fftr4_256(aleftout); //does convolution
fftr4_256(bhrir_l[azi][ele]);
fftr4_mul256(aleftout,bhrir_l[azi][ele]);
fftr4_scale256(aleftout);
fftr4_un256(aleftout);
fftr4_256(arightout);
fftr4_256(bhrir_r[azi][ele]);
fftr4_mul256(arightout,bhrir_r[azi][ele]);
fftr4_scale256(arightout);
fftr4_un256(arightout);
for(readpos=0; readpos<256; readpos++) { *(out2++) = aleftout[readpos]; *(out1++) = arightout[readpos]; }
return (w+7); } // endperform
"640K ought to be enough for anybody." -- Bill Gates, 1981
J. Scott Hildebrand wrote:
i'll just copy and paste my short code which does convolution. it's
not in realtime but right now i'm trying to just get it to spit out audio. this is the error i get:
error: dac~: bad vector size error: dac~: bad vector size Segmentation fault
hi ! no my 1% to the [block~] discussion. the dac~ blocksize is hardcoded (!) to 64 samples. thus you must not place a [block~] object (other than [block~ 64]) into the patch containing adc~/dac~s. You will have to put the routines that need other (bigger) block-sizes into a sub-patch. it doesn't matter, whether you use ordinary-subpatches ([pd ...]) or abstractions (*.pd files).
and now some other features of [block~] (to complicate things a little bit, but with no direct relationship to your problems) [block~] and [switch~] are more-or-less the same object. The difference is only, that [switch~] uses its inlet ([block~] does not, the inlet is for historic(?) reasons only). if you send a "0" to the [switch~] it will turn the audio-engine in its patch and in all of its child-patches off. you can reenable the (local+all children's) dsp-calculations with a "1". both objects eat 3 (optional) arguments, the 2 (by now hopefully) known "block-size" and "overlap-factor", and a 3rd "upsampling-factor" that allows you to up/down-sample the signal in a sub-patch (again: not the (root-)patch that contains the [dac~]/[adc~] !) if given, all of these arguments have to be powers of 2, thus a blocksize of "200" will not work, and you cannot overlap by 1/3rds or do a downsampling by the factor 10. While blocksize and overlap have to be greater 1 (which makes sense), the upsampling factor can also be less than 1 to allow downsampling - like 2^(-2) for downsampling from 44.1kHz to 11.025kHz)
to avoid confusion, you might to want to forget the last paragraph, and reread it later...
mfg.c.asdr IOhannes