Forums > MaxMSP

Artefacts with phasor~ and poke~

May 25, 2010 | 10:00 am

I must be making an obvious mistake here but I am getting artefacts when recording into a buffer driven by a phasor~ that I do not get with count~.

Can anyone show me what I’m doing wrong?

Thanks

– Pasted Max Patch, click to expand. –

May 25, 2010 | 10:36 am

Try to insert a +~ 0.5 after your *~ 176400..


May 25, 2010 | 10:44 am

Thanks yeah I forgot about that.

+~0.5 and trunc~ sorts it out.

Next question, can anyone explain why this works and what it does?

I guess it must mean that the sample index I am passing to poke increases by 1 each time but I don’t really understand why or how?


May 28, 2010 | 10:59 am

When Max converts a float to an int, it does not round. It truncates.

Repeat the above sentence as many times as it takes to understand it. It is absolutely fundamental to how Max works.

If you want to round positive float values, you need to add 0.5 before truncation. If you need to, try it with a couple of values like 0.01, 0.25, 0.499, 0.5, 0.501, and maybe 0.999 to see why it works.

BTW, you need to *subtract* 0.5 before truncation to correctly round negative floats.


July 10, 2010 | 1:25 am

Hi, I try to do the same thing; recording in a buffer~ using poke~ and a phasor~. I put a ~+ 0.5 after the conversion to sample but it still have artefact. Did I miss something?

– Pasted Max Patch, click to expand. –

cheers


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