the other question is this; i will end up having my convolved
samples in an array like:
aleftout[256]
arightout[256]
what i need to do now is read those out to the soundcard, and
originally i thought something like this would work:
for(int read=0; read<=255; read++)
{
out1++ = aleftout[read];
out2++ = arightout[read];
}
well it doesn't work, and i'm not really sure what the mechanism is
to get the samples back into the in/out arrays and then sent to the soundcard. any help is appreciated greatly!
scott
"640K ought to be enough for anybody." -- Bill Gates, 1981
hi,
well, we already explained that what is actually received in a perform routine is a block of n samples not always 256 !!
the n value within a patch is set by a [block~ N] object, where N is a power of two ( can be 256 or anything, you don't know how your object will be used ).
next, if you want to store audio blocks in a 256 array, you've got to have a counter which reminds your writing position like :
{ t_int counter; }
..._perform( ...... ) {
for(i=0; i<n; i++)
{
aleftout[counter] = *(in1++);
counter=(counter+1)%256;
arightout[counter] = *(in2++);
counter=(counter+1)%256;
}
}
restitution is the same problem reverted.
bye,
sevy/yves
J. Scott Hildebrand wrote:
the other question is this; i will end up having my convolved
samples in an array like:
aleftout[256] arightout[256] what i need to do now is read those out to the soundcard, and
originally i thought something like this would work:
for(int read=0; read<=255; read++) { out1++ = aleftout[read]; out2++ = arightout[read]; } well it doesn't work, and i'm not really sure what the mechanism is
to get the samples back into the in/out arrays and then sent to the soundcard. any help is appreciated greatly!
scott
"640K ought to be enough for anybody." -- Bill Gates, 1981
PD-list mailing list PD-list@iem.kug.ac.at http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
hi,
just to make things clearer :
storing the audio blocks in the 256 array :
{ t_int counter; }
..._perform( ...... ) {
for(i=0; i<n; i++) { aleftout[counter] = *(in1++); arightout[counter] = *(in2++); counter=(counter+1)%256; }
}
restoring the 256 array towards the output :
{ t_int readpos; }
..._perform( ...... ) {
for(i=0; i<n; i++) { *(out2++) = aleftout[readpos]; *(out1++) = arightout[readpos]; readpos=(readpos+1)%256; }
}
watchout, if you have a stereo dsp object, the audio inlets/outlets will be passed to the perform routine in the following order :
left-in, right-in, right-out, left-out
that's the clockwise order starting from upper-left corner.
bye,
sevy/yves