I'm trying to create a dynamic processor in PD with attack and release times. I'm assuming the easiest method is to use two line functions to glide between the pre and post compressor levels depending on the attack and release time.
My question is: how do i go about creating a line function that takes the gain to the final value after the input goes above the threshold, and then how to make it go back to the input level once it drops back below the threshold.
I would attach my entire patch at the moment but it's a little messy and confusing at the moment and still a work in progress, I've instead just attached a little extraction of it - I hope it make sense!
Any help with this would be greatly appreciated!
Does anyone know how I would go about rounding a float to the nearest 0.5 (for example 10.4 would become 10.5, and 32.6 would become 32.5, and 101.9 would become 102 etc). I understand how to round floats / convert them into whole integers but cannot find a solution to rounding to the nearest 0.5 float.
Any help will be greatly appreciated!