[sharing unfinished thing] a compressor in gen~
I'm trying to replicate a guitar heavy amplifier kind of sound in max. i may have gotten lost along the way and thought i need a compressor for that. so here is an attempt at making a compressor with gen~. I'm not sure what i'm doing.
There is a buffer of 50 samples that is rewritten each sample and averaged, so it's a circular running buffer, to get the average sound level. Then this level is compared to a threshold and the sound that will be louder than this threshold will be attenuated, according to a ceiling : a maximum ceiling level must be set in dB wherein it will be the new maximum amplitude of the compressed sound. Then there is an automatic makeup gain which will add as much as the ceil level to the sound, so that the new maximum is like the previous maximum.
I am not sure i got the maths right. It seems to work, but, well, sometimes it doesn't seem right, so i don't know, can someone advise ? !
hm, *please* help ?
hey, thanks,
1) probably the design is confusing ; this compressor's aim is to boost instead of reducing the final level ; by reducing difference between peak levels and lower levels ; that's why in each case i add the original input * ceil level (because logically, nothing should exceed ceil level) to get back to a level as close as 1 as possible. I'm not really sure how to visualize efficiently... tho indeed if i seek other people's advice i should care more about making things clear :)
2) it seems better indeed !! and tried the square root of the mean of squares as AK suggested...
i think there are several things i didn't get right. Plus i mistook the wet and dry level...
The running average or rms can also be implemented without a buffer, which makes it cheaper especially with larger buffer sizes.
thanks a lot, that gets better every time!