I'm a real beginner with MAX/MSP. Currently I use it as a prototyping playground to get a bit more used with digital audio Processing.
Right now, I'd like to generate a sort of clipping, that holds on outputting the clipped value for some more samples, after the input Signal already got back under the threshold value. This "hold"-time should be half of the time the input signal was over the threshold. To do that, I thought of something like that:
threshold = 0.6; //fixed value
samples_over=0; //initial value
But if I noticed everything right, the code in the codebox is looped on a sample basis, so assigning 0 to "samples_over" as an initial value just resets its value with every new sample. How do I create a variable with a memory that lasts longer then one loop cycle and just gets one initial value once the signal processing got started? I'm sure this is a basic and simple task - most probably I just don't know the right keyword to google for ;)
Thank you in advance