Making hard limiter with compressor to prevent huge amplitudes
Date | 2016-03-24 19:26 |
From | Anton Kholomiov |
Subject | Making hard limiter with compressor to prevent huge amplitudes |
I'm developing a haskell lib that uses Csound.
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
It generates the Csd's. Maybe you have heard about it. I'd like to save the ears and speakers of my users from huge amplitude values. I'd like to build the limiter that's always on. So that the user doesn't need to know anything about it. I'm using the clip by 0dbfs value right now. But there is a desire to make the algorithm more musical. Clipping often produces unwanted distortion so I'd like to substitute it with a limiter. I know that it have to be implemented with compressor. I know there are dam and compress opcodes. But unfortunately I don't understand the arguments of those opcodes. Can you help me to solve this task? How can I build the limiter that doesn't change the signal if it's below the 0dbfs and prevents the sound from becoming way too huge? Maybe it have to be the combo with limiter and clip after that. Thanks, Anton |
Date | 2016-03-24 19:29 |
From | "Dr. Richard Boulanger" |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
Good luck working on this Anton and please share your results. This "feature" should be an optional setting in Csound (from the command-line or a check-box in CsoundQt And It should, by default, always be set to "on". Dr.B. On Thu, Mar 24, 2016 at 3:26 PM, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
_____________________________________________ Dr. Richard Boulanger Professor of Electronic Production and Design Professional Writing and Music Technology Division Berklee College of Music ______________________________________________ President of Boulanger Labs - http://boulangerlabs.com Author & Editor of The Csound Book - http://mitpress.mit.edu/books/csound-book Author & Editor of The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book ______________________________________________ about: http://www.boulangerlabs.com/about/richardboulanger/ about: http://www.csounds.com/community/developers/dr-richard-boulanger/ music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/ ______________________________________________ email: rboulanger@berklee.edu facebook: https://www.facebook.com/richard.boulanger.58 |
Date | 2016-03-24 19:30 |
From | "Dr. Richard Boulanger" |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
Good luck working on this Anton and please share your results. This "feature" should be an optional setting in Csound (from the command-line or a check-box in CsoundQt And It should, by default, always be set to "on". Dr.B. On Thu, Mar 24, 2016 at 3:26 PM, Anton Kholomiov <anton.kholomiov@gmail.com> wrote:
_____________________________________________ Dr. Richard Boulanger Professor of Electronic Production and Design Professional Writing and Music Technology Division Berklee College of Music ______________________________________________ President of Boulanger Labs - http://boulangerlabs.com Author & Editor of The Csound Book - http://mitpress.mit.edu/books/csound-book Author & Editor of The Audio Programming Book - http://mitpress.mit.edu/books/audio-programming-book ______________________________________________ about: http://www.boulangerlabs.com/about/richardboulanger/ about: http://www.csounds.com/community/developers/dr-richard-boulanger/ music: http://www.csounds.com/community/developers/dr-richard-boulanger/dr-richard-boulanger-music/ ______________________________________________ email: rboulanger@berklee.edu facebook: https://www.facebook.com/richard.boulanger.58 |
Date | 2016-03-24 20:32 |
From | Peter Burgess |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
Hi Anton, I was also in the same boat recently, so I will share what I have learnt this far. compress or compress2 are probably your best bet. Apparently Dam was an experiement and never meant to be used. John recently added compress2 to Csound, which uses dB values that work with any 0dbfs. What you do is set the threshold of the output using the loknee hiknee values, and set ratio to determine how much the sound is squashes above those thresholds. 0 on either knee will represt 0dbfs, and -90 represents near to silence. This is the compressor setting I've got going on the main output of algorythm radio at the moment: ithresh = -90 iloknee = -4 ihiknee = -2 iratio = 10 iatt = 0 irel = 0 ilook = 0 ablank init 1 acompL compress2 amixL, ablank, ithresh, iloknee, ihiknee, iratio, iatt, irel, ilook acompR compress2 amixR, ablank, ithresh, iloknee, ihiknee, iratio, iatt, irel, ilook I'm still not sure it's ideal, but it's working at the moment while I develop. If I have this right (and I still might not): my loknee + hiknee value mean I'm only starting to compress a little from -4dB up, and compressing fulling from -2dB up. ratio of 10 means all sounds above -2dB are being reduced by 10dB, which means by a magnitude of 10. I'm still not sure what threshold actually does, it might have something to do with the sidechain function, it doesn't seem to make much difference when I change it, so I'm just leaving it at -90. ablank is where a sidechain modulator would be if I was using one, so I just set this to 1 to represent a constant signal to keep the compressor active. Feel free to ask more questions if you have any, and hope this helps. Pete On Thu, Mar 24, 2016 at 7:30 PM, Dr. Richard Boulanger |
Date | 2016-03-25 11:04 |
From | Anton Kholomiov |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
@Pete Thanks for the solution! I think I'll integrate it into my lib. I need to use `compress`. I'd like to not to use very recent opcodes for default things. In that case with `compress` do I need to use ampdbfs to convert your values for knees? or it have to be `ampdb`? 2016-03-24 23:32 GMT+03:00 Peter Burgess <pete.soundtechnician@gmail.com>: Hi Anton, I was also in the same boat recently, so I will share what I |
Date | 2016-03-25 11:40 |
From | Anton Kholomiov |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
Also in the manual the suggested value for ratio is 100 (if you want to implement the limiter). Do you have any thoughts on that? reason behind your being 10 you don't want to have a lot of compression? 2016-03-25 14:04 GMT+03:00 Anton Kholomiov <anton.kholomiov@gmail.com>:
|
Date | 2016-03-25 15:45 |
From | Oeyvind Brandtsegg |
Subject | Re: Making hard limiter with compressor to prevent huge amplitudes |
Just my 2c, if you want a simple limiter, the clip opcode may work reasonaby well. It does soft clipping, and the default (Bram de Jong) method works nicely IIRC. I've used it a lot earlier, but not recently. I seem to recall I put the clipping start point at 0.75, instead of the default 0.5. 2016-03-25 12:40 GMT+01:00 Anton Kholomiov |