Hi Graeme,
This is a little complicated, but certainly not impossible.
First, I'd suggest reading this primer on the basics of monitoring the level of a signal inside the SigmaDSP:
Measuring time can be a bit tricky. However, it looks like there is a new timer in the library that I've never seen before. "Timer Coarse Long Time" seems like it would do the trick.
This cell doesn't appear to have a help article associated with it yet, but if you read the description when you hover the mouse over the cell, it looks like an input of 1 starts the timer, an input of 0 resets the time, and the timer counts up to the specified time using the specified accuracy.
The output will be zero until the timer reaches the specified value, and then it will become 1.
Here's what the cell looks like in the project.
In the first part of your description, you said you want to count up to 3 seconds. I assume a 1 ms accuracy is OK, so here are the corresponding settings.
The input should be a logic signal that compares the input level to a specified threshold. We can get this circuit from the FAQ I posted.
You'll then need some logic to control the timer... I haven't tested this out yet, but I think this project is a good starting point.
Basically, I use the timer's output to control a multiplexer. If the time has not yet been reached, it outputs a copy of the input signal. If the timer has been reached, meaning that the input signal is too big, then it outputs a reduced-gain copy of the input signal.
You could use this same logic to implement mute functions, if desired.
Hopefully this is a good starting point for you.