AudioKit / AudioKitSynthOne

AudioKit Synth One: Open-Source iOS Synthesizer App
http://audiokitpro.com/synth
MIT License
1.69k stars 219 forks source link

Saturation/limiter/clipper/rectifier option #134

Open willis936 opened 4 years ago

willis936 commented 4 years ago

Could a saturation module be added? Something like a zener limiter with controllable current (controls rolloff) would be nice. Sorry if it’s already there and I missed it.

marcus-w-hobbs commented 4 years ago

Do you have a specific AudioKit component/signal chain in mind or do you want me to put something together?

818 802 4085 marcushobbs@mac.com

On Dec 24, 2019, at 11:43 AM, willis936 notifications@github.com wrote:

 Could a saturation module be added? Something like a zener limiter with controllable current (controls rolloff) would be nice. Sorry if it’s already there and I missed it.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub, or unsubscribe.

willis936 commented 4 years ago

I’m not familiar with audiokit but an okay first pass approximation would be an “if input is above limit then set output to the limit”. This is the behavior of transistor guitar amplifiers or opamp zener limiters, and is not very pleasing to listen to. A lowpass filter on the output helps. This isn’t exactly how the nice sounding analog circuits behave.

Properly simulating a zener limiter (or a tube) involves a bit of math, which I don’t have time for at the moment, but may in the next week or two.

Here is the model of a zener: https://www.onsemi.com/pub/Collateral/AND8250-D.PDF

Zener limiters are used because they sound warm. The zener limiter circuit needs to be distilled into a simple input/output with some fixed, typical parameters. A zener limiter circuit is two zener diodes in series with opposing polarity, all in parallel with the load. The current through the zener will be dependent on the source voltage, source resistance, and load resistance.

Tubes are often liked for their sound as well. I’m not as familiar with models for these, but I’m sure they exist and will look around. https://en.wikipedia.org/wiki/Tube_sound

marcus-w-hobbs commented 4 years ago

S1 has a compressor at the end of the chain that can act like a limiter. It’s in a hidden panel (we call it the “HAQ” panel, or “Dev” panel). You can access it by pressing on “About”, and then pressing the “AudioKit Synth One” header graphic. There is an array of knobs for three compressors, the last one being “Master Compressor”.

Brice Beasley, one of the key sound designers, exploited this feature for the effects you’re describing.

Can you play with it and let me know if it’s what you had in mind?

Attached are some presets of Brice’s that exploit this feature.

On Dec 24, 2019, at 4:59 PM, willis936 notifications@github.com wrote:

I’m not familiar with audiokit but an okay first pass approximation would be an “if input is above limit then set output to the limit”. This is the behavior of transistor guitar amplifiers or opamp zener limiters, and is not very pleasing to listen to. A lowpass filter on the output helps. This isn’t exactly how the nice sounding analog circuits behave.

Properly simulating a zener limiter (or a tube) involves a bit of math, which I don’t have time for at the moment, but may in the next week or two.

Here is the model of a zener: https://www.onsemi.com/pub/Collateral/AND8250-D.PDF https://www.onsemi.com/pub/Collateral/AND8250-D.PDF Zener limiters are used because they sound warm. The zener limiter circuit needs to be distilled into a simple input/output with some fixed, typical parameters. A zener limiter circuit is two zener diodes in series with opposing polarity, all in parallel with the load. The current through the zener will be dependent on the source voltage, source resistance, and load resistance.

Tubes are often liked for their sound as well. I’m not as familiar with models for these, but I’m sure they exist and will look around. https://en.wikipedia.org/wiki/Tube_sound https://en.wikipedia.org/wiki/Tube_sound — You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/AudioKit/AudioKitSynthOne/issues/134?email_source=notifications&email_token=AD5L5X6W7YX2ZH5Z766KMI3Q2KV7XA5CNFSM4J7AOEKKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEHTXBXQ#issuecomment-568815838, or unsubscribe https://github.com/notifications/unsubscribe-auth/AD5L5XYC4KRZM7NEIYI7PQLQ2KV7XANCNFSM4J7AOEKA.

willis936 commented 4 years ago

I can’t see any screenshots in the github issue page. I played with the settings you mentioned. I am not 100% certain, but I think they may be dynamic range compressors rather than clippers. I was unable to use them to force clipping.