[PD] max value of last n samples

Miller Puckette msp at ucsd.edu
Fri Feb 2 18:03:02 CET 2018


If you need this as a mesage, you can continually stuff the signal into an
array and use array max (which can be set to look at a subinterval of the
array.)  You can use an array as a circular buffer by always maintaining two
write pointers into the same array - whichever one is in front at any time
is at the head of a contiguous strip of past samples.

I don't know any way to get the value out as a signal (something for
me to think about)...

cheers
Miller

On Fri, Feb 02, 2018 at 04:59:30PM +0100, Roman Haefeli wrote:
> On Fre, 2018-02-02 at 16:30 +0100, tim vets wrote:
> > is this any good?
> > [ fexpr~ if($x1[0]>$y1[-1], $x1[0], $y1[-1]) ]
> 
> This will never return from the highest value ever experienced. I
> really need the output to return after N samples.
> 
> > not sure how to reset it though...
> 
> Exactly.
> 
> Roman



> _______________________________________________
> Pd-list at lists.iem.at mailing list
> UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list




More information about the Pd-list mailing list