# Mix N sinusoidal waveforms without clipping but at a costant amplitude with no clipping and maximum amplitude

I need to mix "n" sinusoidal waveforms which can be all active or some or all can be silent. The math seemed simple (working with float32 samples) because I just added all waveforms and then divide the result by 10 but the result is not what I wanted (too faint).

So, empyrically I found that the right value to divide the sum is not "n" but was something around 3.3 when N is 10.

Searching around I found another valid formula... which is to divide the sum by the square root of the number of waveforms...but also that doesn't seem quite right...

I wonder if that is true or there is a better formula (considering that the sinuses are going from 1 to -1.

The N frequencies are never multiple of each other and never "sync". I think the formula must include some triginometry and the difference in waveforms frequencies in Hz... just by instinct...

Any idea?

1. Amplitude scaling: $$1/N$$. This will guarantee that the resulting wave form will not clip but the ernergy of the sum will a be a lot less than the sum of the energies, i.e. it will be very soft.
2. Energy Scaling: $$1/\sqrt{N}$$. This will make sure that the energy of the sum equals the sum of the energies, so it's equally roughly loud. However, there is risk of clipping.