I put together this little auto-mute device in Bitwig to cut the sound if the audio gets too loud. I was experimenting with some feedback loops the other day and at one point got blasted with some pretty loud sounds by accident, so I can throw this on the master and with will cut the sound immediately if it gets above 0db.

It’s fairly simple, it just tracks the amplitude and compares the input level to a 0db signal, and if it gets above 0, it creates a 1 value. The 1 is then flipped to a 0 with a NOT module and the amplitude of the original signal is multiplied by it. So basically as long as the amplitude is below 0db the signal passes through, and if it gets above 0db, the signal gets cutoff.