increasing audio distortion without increasing volume level
Hi guys,
I'm using overdrive~ in a patch I'm working on, but I want to be able to distort the sound without changing the level. I tried using scale to decrease the volume as the slider increased the overdrive. The slider ranges from 1-20, so by scaling it I could get the volume to be the same at 20 as it was at 1, but anywhere in between was still louder. My initial thought is to use a table to create a curve, and read through it with the same slider that is controlling the overdrive amount. The values from the table would then control the *~ object to retain the same audio level. I know this would work, but am not sure if it is the best, or most logical way to go about it...
Any advise would be greatly appreciated.
Thanks,
Christian
I don't believe there's an easy fix for this - you could try [clip~] on the output of your distortion but this will add a second distortion treatment to your sound which is probably not what you're after.
The problem with making the output *equal loudness* asks the question of whether you're after equal perceived loudness or equal peak loudness - while peak loudness may be workable, adding distortion adds lots of harmonics and will always make signals of identical amplitudes sound much louder than their untreated counterparts.
You're on the right track for a quick fix solution though, but rather than treating your levels in a linear fashion remember that amplitudes and decibels are a log scale - use [expr "pow($f1,$f2)"] or similar on your unscaled 0-1 parameters set the exponent $f2 to wherever gives the best transition.
quick and dirty:
Thanks guys. I've been at work all day, but will have a look into these tomorrow.
One thing which often works great, is to calculate the rms of the signal (with average~ for instance) of the input signal, and the processed signal. You can then find the amplitude ratio to compensate.