Forums > Java

MSPbuffer and sampling rate

September 22, 2006 | 7:38 am

I just got bitten trying to use Fred’s buf.Op extensions for offset copying because I didn’t realise that the offsets are samples, rather than times. Looking at the javadoc for MSPBuffer, I see getLength and getSize which would in theory give me a way of working out sampling rate, but what’s the expected behavior if you set one or other?

Do you need to set both in order to get a particular sampling rate, or is that superfluous because setting either actually changes the size of the buffer?

I thought I’d sit back and ask what was supposed to be happening rather than rely on any conincidental behavior I could discover through trial and error…

B>


September 27, 2006 | 5:27 pm

Hi Bruce,

The "official" sampling rate of a buffer~ is tied to the sampling rate
of its containing patcher. setLength uses this sampling rate to
calculate the number of samples based on the requested length. You can
use setSize to resize it to any number of samples.

Ben

On 9/22/06, Bruce Murphy

wrote:
>
> I just got bitten trying to use Fred’s buf.Op extensions for offset copying because I didn’t realise that the offsets are samples, rather than times. Looking at the javadoc for MSPBuffer, I see getLength and getSize which would in theory give me a way of working out sampling rate, but what’s the expected behavior if you set one or other?
>
> Do you need to set both in order to get a particular sampling rate, or is that superfluous because setting either actually changes the size of the buffer?
>
> I thought I’d sit back and ask what was supposed to be happening rather than rely on any conincidental behavior I could discover through trial and error…
>
> B>
> –
> Nihil Illigitemi Carborvndvm
>


Viewing 2 posts - 1 through 2 (of 2 total)