Pd does the increment and time stuff in double precision. You're likely
losing precision by going with float for everything; if you divide
100/44100 and get a float, and then increment 0 with it 44100 times, you're
not necessarily going to end up with exactly 100 at the end.

See attached.

M

On Fri, Oct 2, 2015 at 12:44 PM, i go bananas <[email protected]> wrote:

> yeah, am considering the option of just manually setting once the ramp
> finishes.  But considering that i'm off by about 0.1% every 44100 samples,
> it's a bit worrying.  Would be ok for synth envelopes, etc...but i'll
> probably want to use this to lookup audio file tables, etc too, in the
> future, so kinda want to get it spot on.
>
> right now, the performDSP function is literally a single conditional and
> then += increment, which seems nice and lightweight.  i'd like to aim to
> keep it as close to that as possible...
>

Attachment: divide-and-increment.pd
Description: Binary data

_______________________________________________
[email protected] mailing list
UNSUBSCRIBE and account-management -> 
http://lists.puredata.info/listinfo/pd-list

Reply via email to