[PD] counter question

martin.peach at sympatico.ca martin.peach at sympatico.ca
Thu Jul 26 20:23:04 CEST 2007


Derek Holzer wrote:
> If I use a simple counter structure that continues to generate a number 
> from [f] & [+1] at every bang, and use [mod] to keep that number within 
> certain bounds, then eventually it will require more and more memory to 
> hold the number coming from [f], right? Is this a potential memory leak, 
> or is there a cap to how much memory it will hold?

A float always uses 4 bytes. When the number gets too big, mod won't work properly because the number it's working on won't be accurate. It won't ever use any more memory.
But if you use the output of [mod] to reset the float, it will never be a problem because the float will never get larger than the output of [mod].


Martin





More information about the Pd-list mailing list