cheapo protection
Author
Mikko Apo (apo@iki.fi)
Check out my pages for more buzz stuff and music.
Excellent skin made by Hymax.
Short description
"cheapo protection" is designed to prevent loud bursts of sound from destroying your ears and your equipment. It can also be used as a distortion effect and a gapper. It has also signal analysis code which analyses the maximum amplitude of your signal and can suggest the best values for volume sliders to prevent signal from clipping.
Parameters
NameMin.Max.DefaultDescription
Mode061Modes: 0 Analyse, 1 Ana + Prot, 2 Ana + ASR, 3 Ana + AuxbusASR, 4 AuxbusASR, 5 ASR, 6 Prot
Threshold06553432768Threshold: 0dB=0x8000(32768), +14dB=0xFFFE(65534)
Delta06553440960Max difference: 100%=0xA000(40960), 249%=0xFFFE(65534)
Level06553432768Sustain level: 0dB=0x8000(32768), +19.1dB=0xFFFE(65534)
Attack0655341Attack time in units
Sustain0655341Sustain time in units
Release0655341Release time in units
Attack Unit0655341Attack Unit: 0=tick (default), 1 ticks/256, 2 samples, 3=ms, 4=seconds
Sustain Unit0655341Sustain Unit: 0=tick (default), 1 ticks/256, 2 samples, 3=ms, 4=seconds
Release Unit0655341Release Unit: 0=tick (default), 1 ticks/256, 2 samples, 3=ms, 4=seconds
Modes
0 AnalyseOnly analyse code is used.
Parameters in use: None
1 Ana + ProtAnalyse code is used and a simple burst protection which clips the signal to zero when a burst is detected for the duration of time which is defined by Attack parameters.
Parameters in use: Threshold, Max Delta, Attack, Attack Unit
2 Ana + ASRAnalyse and all the parameters of the ASR-envelope. This allows fine control over the triggered envelope so that it can be used as a musical effect.
Parameters in use: All
3 Ana + AuxbusASRAnalyse and the all ASR-controls. First ASR-envelope is controlled by the AUXBUS signal and the following are controlled by the main signal.
Parameters in use: All
4 AuxbusASRSame as Mode 3 but without the analyse code.
5 ASRSame as Mode 2 but without the analyse code.
6 ProtSame as Mode 1 but without the analyse code.
With modes 2-5 you can use multiple ASR-envelopes by adding tracks. When using Auxbus modes the first track will be controlled by the Auxbus signal and the following tracks will be controlled by the main signal.
Sound analysis
Detected amplitude levels The maximum and minimum values are shown as absolute and in decibel values.
Average dc offset is calculated and shown.
"In" means the signal that comes in "cheapo protection" and "Out" means signal that has been processed by "cheapo dc".
Clipping limits Buzz handles musical data as floats instead of more limited int format.
When the signal is outputed from Buzz it has to be limited to the normal range of sound data. If the signal is louder then the limits then it is clipped which means that the sound is altered.
Limits for 16bit sound data are: -32768 minimum and 32767 maximum.
Suggested volume slider settings "cheapo protection" calculates and shows the best values for the input volume slider of the next machine and the master volume output slider.
Please note that if you connect anything else to the master/next machine the calculation is not correct. Some machines behave sometimes randomly so it is better to leave some "room" on your volume settings.
Usage
  1. Connect "cheapo protection" as a normal effect.
  2. Select the mode you wish to use.
  3. If you are using AUXBUS modes you must set the used channel from the machine menu and you must connect some auxsend machine.
  4. Play your song.
  5. When you want to check the analysis just select "Show analysis" from the machine menu.
  6. You can reset the analysis from "Reset analysis"
Detection methods
"cheapo protection" detects bursts with two simple algorithms:

When a signal that is louder then threshold is detected the envelope is triggered.
In pseudo-code:

if fabs(sample) > threshold				// we have a burst
The "Max Delta" settings means that "cheapo protection" compares the current sample to the previous one and if the difference is bigger then "Max Delta" setting it is considered a burst.
In pseudo-code:
if fabs(sample - Previous_sample) > maxDelta		// yep, a burst
Tips
When finetuning your envelope settings you can get different results by if move the values just a little bit.

Use always a limitter after "cheapo protection" if you use small timing values in envelope or small detection thresholds because they can cause very loud peaks (+80dB for example).