Re: [PD] max value of last n samples

2018-02-04 Thread Roman Haefeli
On Son, 2018-02-04 at 13:12 +, Dario Sanfilippo wrote: > Hi, Roman. I guess that fexpr~ implies block 1 but probably a few > other things too: 256 instantiations of the feedback loop in my > abstractions are around 44% load whereas the same number of [fexpr~ > max($x1[0], $y[-1]*$x2[0])] are 

Re: [PD] max value of last n samples

2018-02-04 Thread Alexandre Torres Porres
hi, I tried only using fexpr~, here's what I got [image: Imagem inline 1] #N canvas 627 57 454 302 10; #X obj 352 105 v n_\$0; #X floatatom 352 74 5 0 0 0 - - -, f 5; #X obj 59 117 v count_\$0; #X obj 132 112 fexpr~ count_\$0 = $y2[-1] + 1 \; if(count_\$0 > n_\$0 \, 1 \, count_\$0); #X obj 34

Re: [PD] max value of last n samples

2018-02-04 Thread Dario Sanfilippo
That's certainly the way to go for efficiency: 256 rpole~ objects are about 10% load against 44% load of the PD-implemented counterpart. D On 4 February 2018 at 14:41, Matt Davey wrote: > Really at that point, you’d have to be asking youself if there is any way > to use an

Re: [PD] max value of last n samples

2018-02-04 Thread Matt Davey
Really at that point, you’d have to be asking youself if there is any way to use an external. On Sunday, February 4, 2018, Dario Sanfilippo wrote: > Hi, Roman. I guess that fexpr~ implies block 1 but probably a few other > things too: 256 instantiations of the

Re: [PD] max value of last n samples

2018-02-04 Thread Dario Sanfilippo
Hi, Roman. I guess that fexpr~ implies block 1 but probably a few other things too: 256 instantiations of the feedback loop in my abstractions are around 44% load whereas the same number of [fexpr~ max($x1[0], $y[-1]*$x2[0])] are peaking at 95%. D On 4 February 2018 at 12:33, Roman Haefeli

Re: [PD] max value of last n samples

2018-02-04 Thread Roman Haefeli
On Fre, 2018-02-02 at 18:31 +, Dario Sanfilippo wrote: > There's an implementation of a peak holder in this blog post: http:// > dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-in- > pure-data.  BTW: the peak envelope part could be also implemented using fexpr~: [fexpr~

Re: [PD] max value of last n samples

2018-02-03 Thread Roman Haefeli
On Sam, 2018-02-03 at 12:42 +, Dario Sanfilippo wrote: > I see what you mean, Roman. So you'd need the N-size block to be > processed beforehand, which would imply an N-size delay in the > output, is that right? Actually, your peak holder implementation does the job well for me. I was (and

Re: [PD] max value of last n samples

2018-02-03 Thread Dario Sanfilippo
I see what you mean, Roman. So you'd need the N-size block to be processed beforehand, which would imply an N-size delay in the output, is that right? I haven't thought of it, no idea whether that could be achieved by changing the feedback period in the peak holder and/or adding a delay in the

Re: [PD] max value of last n samples

2018-02-03 Thread Roman Haefeli
On Sam, 2018-02-03 at 02:47 +, Dario Sanfilippo wrote: > Thanks, Roman. > > On 2 February 2018 at 21:28, Roman Haefeli > wrote: > > On Fre, 2018-02-02 at 18:31 +, Dario Sanfilippo wrote: > > > There's an implementation of a peak holder in this blog > > post: http:// >

Re: [PD] max value of last n samples

2018-02-02 Thread Dario Sanfilippo
Thanks, Roman. On 2 February 2018 at 21:28, Roman Haefeli wrote: > On Fre, 2018-02-02 at 18:31 +, Dario Sanfilippo wrote: > > There's an implementation of a peak holder in this blog post: http:// > > dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-in- > >

Re: [PD] max value of last n samples

2018-02-02 Thread Alexandre Torres Porres
check [pd [fexpr~] Examples] in the help file of expr~ :) [image: Imagem inline 1] 2018-02-02 13:59 GMT-02:00 Roman Haefeli : > 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

Re: [PD] max value of last n samples

2018-02-02 Thread Roman Haefeli
On Fre, 2018-02-02 at 18:31 +, Dario Sanfilippo wrote: > There's an implementation of a peak holder in this blog post: http:// > dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-in- > pure-data. I remember testing it but please let me know if you find a > bug. Very nice write

Re: [PD] max value of last n samples

2018-02-02 Thread Dario Sanfilippo
There's an implementation of a peak holder in this blog post: http://dariosanfilippo.tumblr.com/post/162523174771/lookahead-limiting-in-pure-data. I remember testing it but please let me know if you find a bug. The current peak is replaced to whatever the input is after a desired time, and the

Re: [PD] max value of last n samples

2018-02-02 Thread Miller Puckette
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

Re: [PD] max value of last n samples

2018-02-02 Thread Roman Haefeli
On Fre, 2018-02-02 at 23:27 +0900, Matt Davey wrote: > i did something like that with a bang~ just triggering a counter to > read samples from tabsend~, but not very efficient, of course.  I don't mind converting to message and then back to signal. I did that a few times, too. But I believe

Re: [PD] max value of last n samples

2018-02-02 Thread Roman Haefeli
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

Re: [PD] max value of last n samples

2018-02-02 Thread tim vets
is this any good? [ fexpr~ if($x1[0]>$y1[-1], $x1[0], $y1[-1]) ] not sure how to reset it though... gr, Tim 2018-02-02 15:58 GMT+01:00 martin brinkmann : > On 02/02/18 14:52, Roman Haefeli wrote: > > Can this be done in vanilla? I'd like to output the maximum value of

Re: [PD] max value of last n samples

2018-02-02 Thread martin brinkmann
On 02/02/18 14:52, Roman Haefeli wrote: > Can this be done in vanilla? I'd like to output the maximum value of > the last N input samples in the signal domain. Ideally N would be > adjustable.  i have used cascaded samphold~ objects in a similar situation. though n is not exactly adjustable this