Artefacts with phasor~ and poke~

May 25, 2010 at 10:00am

Artefacts with phasor~ and poke~

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. –
#50547
May 25, 2010 at 10:36am

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

#181324
May 25, 2010 at 10:44am

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?

#181325
May 28, 2010 at 10:59am

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.

#181326
Jul 10, 2010 at 1:25am

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

#181327

You must be logged in to reply to this topic.