//SLUGens released under the GNU GPL as extensions for SuperCollider 3, by Nick Collins, http://composerprogrammer.com/index.html
In this UGen a target buffer gets sorted into increasing sample values over time- the sorting process causes gradual distortion. The sorting algorithm used is just a naive one of O(N^2) so effects are very dependent on sample length and sorting speed. It works best with small buffers and large sorting speeds will make it very CPU intensive.
SortBuf assumes that the sample rate of the target buffer is the same as the soundcard output sample rate.
target buffer, will be overwritten by the procedure.
number of sorting iterations per play through of the buffer
restart the sorting procedure.