After some experimentation I have now got a working amplitude dependant distortion waveshaper using chebyshev polynomials. The code looks at the amplitude level and depending on the number adds specific polynomials too the output variable. The only problem is that it is extremely computationally excessive and needs to be tested on another pc to establish what the problem is. I have a feeling as the amplitude changes so often there are too many process leading to too much distortion and sometimes crashing. I am currently in the process of updating this as well as including a control on the amount of distortion in general.