[PD] oh yeah
Yves Degoyon
ydegoyon at free.fr
Sat Aug 24 03:14:40 CEST 2002
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 at iem.kug.ac.at
>http://iem.kug.ac.at/cgi-bin/mailman/listinfo/pd-list
>
>
More information about the Pd-list
mailing list