If you want to work in the audio domain, consider calculating the RMS by simply squaring, low-passing, and taking the sqrt of the signal. The cutoff determines your averaging window.

You can implement relational operators in the audio domain by using [/~], as the same signal connected to both of its inputs will give 0 when the signal is 0, and 1 otherwise. There was a nice conversation on the PD facebook group on this. Thanks to Matt Barber. 

For example:

[inlet~] [inlet~]
| \          |
|   \        |
|     \      |
|    [max~]
|     /
[-~   ]
|    \
[/~   ]
|
[outlet~]

is [<~].

You can then use a lowpass to slow down the transitions between true or false. The impulse response of [rpole~] will decrease of ~60dB (1/1024) in a desired time by setting the feedback coefficient B with B = .001^t/T60. t is the feedback period N/Fc and T60 is the decay time in sec. [rpole~] is an IIR but it will truncate to 0 when its output gets very small. Approximately, using the formula above, it will get to 0 after a desired time if you multiply the decay time by .158065.

Cheers,
D

On 9 September 2016 at 07:47, enrike <altern2@gmail.com> wrote:
thanks Jaime. I was checking fiddle~ and bonk~ but I guess env~ goes more to the point.

og., 2016.eko iraren 08a 18:08(e)an, Jaime Oliver igorleak idatzi zuen:

env~ should help you do that.

J



On Sep 8, 2016, at 9:01 AM, enrike <altern2@gmail.com> wrote:

hi all

is there any abstraction or external that allows to detect silence in the sound in? I mean if the amplitude drops below a threshold for a given period of time.

I was thinking about how to get this going to try to build it myself then I thought there might be some external or abstraction that already does what I need. Tired of reinventing the wheel...

thanks

enrike

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




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