[Csnd] "soft clipping"
Date | 2017-10-28 20:53 |
From | Michael Mossey |
Subject | [Csnd] "soft clipping" |
I like the soft clipping effect I get with some commercial software synths. I think in some cases they say they are modeling tubes or tape. Does Csound have something similar? Does the "clip" opcode do the same thing?
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
Mike |
Date | 2017-10-29 01:44 |
From | Emmett Palaima |
Subject | Re: [Csnd] "soft clipping" |
Doing a tanh function on your signal is an easy way to create soft clipping, since the output of tanh is essentially a soft clipping transfer function. This is not an opcode per se, but can be done in one line like so: aclip = tanh(asig) or as an input to an opcode, since its simply a math function. Another way to do this is via polynomial distortion, as is talked about in this CCRMA article: https://ccrma.stanford.edu/realsimple/faust_strings/Cubic_Nonlinear_Distortion.html You can easily implement this with the polynomial opcode, and it has the advantage of being very customizable. You will probably want to use clip to hard limit your signal in the range +/- 1 before using this though, as the transfer functions created by polynomials will start to behave different when the input values are no longer fractional. On Sat, Oct 28, 2017 at 3:53 PM, Michael Mossey <michaelmossey@gmail.com> wrote:
|
Date | 2017-10-29 07:34 |
From | Michael Mossey |
Subject | Re: [Csnd] "soft clipping" |
Thanks. Do you recommend using oversampling when adding distortion, by running a UDO at a higher rate than the orchestra rate? Or is that possible? Mike On Sat, Oct 28, 2017 at 6:44 PM, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2017-10-29 16:07 |
From | Emmett Palaima |
Subject | Re: [Csnd] "soft clipping" |
I believe what they are talking about is using an oversampling filter after the distortion, in order to band-limit the effect and prevent aliasing that might be caused by the distortion adding harmonics above the nyquist frequency. I believe a lot of the csound filter opcodes use oversampling internally (I know moogladder does for example), so you might be able to use those. Perhaps butterlp. However, think the oversampling is more of something they are recommending to deal with aliasing if it becomes audible, rather than something that is necessary to the effect. At low distortion levels you may not need it at all. On Sun, Oct 29, 2017 at 3:35 AM Michael Mossey <michaelmossey@gmail.com> wrote:
|
Date | 2017-10-29 19:50 |
From | Michael Mossey |
Subject | Re: [Csnd] "soft clipping" |
Thanks. I suspect I want the oversampling, because I've been playing with distortion effects in the UVI Falcon synth... I love the extra zing and presence that a little distortion adds... actually quite a musically expressive effect. The UVI Falcon distortion effects allow me to select oversampling up to 16x, and it makes a big difference to the pitch definition and the proper quality of harmonic intervals and chords. Mike On Sun, Oct 29, 2017 at 9:07 AM, Emmett Palaima <epalaima@berklee.edu> wrote:
|
Date | 2017-10-29 20:24 |
From | Emmett Palaima |
Subject | Re: [Csnd] "soft clipping" |
Yes, oversampling the anti-aliasing filter will definitely lead to clearer, less muddy results, especially on harmonically rich content. This is true of any filter: I remember when I first discovered this on the Ableton EQ. Oversampling the transfer function itself won't do anything, since it is not time based. It simply says given value x as an input you will get value y as an output. A filter however is a time based effect, so oversampling can make a big difference. If you want to experiment with oversampling, do so on the filter you use after the distortion transfer function. On Sun, Oct 29, 2017 at 3:50 PM, Michael Mossey <michaelmossey@gmail.com> wrote:
|
Date | 2017-10-30 08:50 |
From | Michael Mossey |
Subject | Re: [Csnd] "soft clipping" |
That makes sense. I was getting a little careless with terminology, but I see how oversampling the anti-aliasing filter would help.
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
Mike |
Date | 2017-10-30 08:58 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] "soft clipping" |
Just my 2 cents, I think you have to do the oversampling before the actual distortion, to prevent aliasing appearing due to the added harmonics. Filtering with oversampling after the aliasing has occured won't get rid of the artifacts. 2017-10-29 21:24 GMT+01:00 Emmett Palaima <epalaima@berklee.edu>:
Oeyvind Brandtsegg Professor of Music Technology NTNU 7491 Trondheim Norway Cell: +47 92 203 205 http://www.partikkelaudio.com/ http://crossadaptive.hf.ntnu.no http://gdsp.hf.ntnu.no/ http://soundcloud.com/brandtsegg http://flyndresang.no/ http://soundcloud.com/t-emp |
Date | 2017-10-30 15:10 |
From | Emmett Palaima |
Subject | Re: [Csnd] "soft clipping" |
Hmm... why would you add the filter prior to the distortion? The input signal is ostensibly already band limited, whereas the distortion is adding a variable amount of harmonic content. The entire issue with aliasing is due to the fact that the added harmonics may be above the nyquist, and this is still the case for a band-limited input signal. It makes much more sense to me to have a filter after the distortion to get rid of these frequencies once they are present, rather than attempting to give the transfer function an input which won't create these frequencies. Is there a reason this is not the case? On Mon, Oct 30, 2017 at 4:58 AM Oeyvind Brandtsegg <oyvind.brandtsegg@ntnu.no> wrote:
|
Date | 2017-10-30 15:18 |
From | JTG III |
Subject | Re: [Csnd] "soft clipping" |
I think that means you have to oversample the distortion function itself, then filter before resampling back down to whatever sr you're using, or else the aliasing will be in the signal already by the time you oversample and filter, which will have no effect on any frequencies folded over beneath your antialias filter, making the whole exercise rather ineffective. On Oct 30, 2017 11:10 AM, "Emmett Palaima" <epalaima@berklee.edu> wrote:
|
Date | 2017-10-30 18:32 |
From | Oeyvind Brandtsegg |
Subject | Re: [Csnd] "soft clipping" |
Yes, that was what I meant :-) 2017-10-30 16:18 GMT+01:00 JTG III <jordanthomasgibbonsiii@gmail.com>:
Oeyvind Brandtsegg Professor of Music Technology NTNU 7491 Trondheim Norway Cell: +47 92 203 205 http://www.partikkelaudio.com/ http://crossadaptive.hf.ntnu.no http://gdsp.hf.ntnu.no/ http://soundcloud.com/brandtsegg http://flyndresang.no/ http://soundcloud.com/t-emp |