Hi. I'm still kind of a novice at pd, so what I'm trying to might not be a good idea. It doesn't seem to be working any how.
Anyways, I was trying to make a distortion type deal where you select a window in the signal, say .5 to .75 of the absolute value of the signal, or whatever you like, and have it so the signal below that window (say 0 to .5) isn't reduced in amplitude, the signal above that window (.75 to 1) is reduced by a factor of your choice, I'll call it a, a value between 1 and 0, and the signal within the window ramps steadily from no reduction to reduction by a factor of a, so it's smooth.
What I've been doing for this is multiplying the whole signal by a clipped version of the absolute value of the signal that's multiplied and added to such that instead of going from .5 to .75 it goes from 1 to a. So, anything below .5 is multiplied by 1, anything above .75 is multiplied by a, and everything in between is multiplied by something between 1 and a. I thought this would produce a smooth sort of distortion, depending on how much the amplitude is reduced by and the width of the window, but no matter what I do I get a harsher distortion, and there are little rectangular cuts in the peaks that shouldn't be there, unless my logic about all of this is wrong.
This is roughly what's going on.
Signal
|
abs~
|
clip~ .5 .75
|
-~ .5 ( 0 to .25)
|
/~ .25 (0 to 1)
|
*~ -(1 - a) (given a reduction factor of .6 this would be 0 to -.4)
|
+~ 1
And that would result in a range of 1 to .6. And I multiply that by the original signal. I'm just kinda messing around with pd trying to make stuff, so maybe this is just a bad way to do this. Is it just too many operations on the clip to multiply it at the right time?
I can put a patch on this later if you need.