You should be able to sort control rate signals by writing them into a buffer, then sorting that. I don’t think there is a good Ugen to do this sorting in the SCClass library, but there must be one out there somewhere. Perhaps Flucoma has one?
Sorting audio rate signals (at audio rate) is complex though (if you only want to sort by the first sample it is the same as control rate), because you needs to fake having a block size of one. I know mis_lib has some things to do this, I think it would be possible to make a sorter out of that… but it would not be easy, nor fast to run.
But this raises a question, what does it mean for one audio signal to be less than another? Sorting by high frequency content or amplitude would often make more sense, all of which are control rate signals.
Using ArrayMax from the scplugins, I could see the maximum value and the index of the UGen in the array that outputs the maximum value. However, the index is not an integer but an OutputProxy. So it is not possible to sort an UGen array in a Synth. Using SendReply and OSCFunc (or OSCdef) seems to be the only way at the moment, but there is no benefit to doing so.
I think it would be very handy if there was a converter that would convert the current output value of a Ugen to a float or integer. Max has such functionality: snapshot~ and the right output of number~. Maybe in SC4?
Not possible, there are only ugens on the server. Numbers are converted to ugens when the synthdef sends them to the server (simplification), these numbers are immutable and cannot change.
Select is used to select a ugen (or a ugen with an adjacent ugen or ugens) from an ugen array. Currently I am trying to find a way to sort the ugen indices by their output values, for example: Rand. In this case I could not find a way to use Select to sort the array by the output value of the ugens.
Sorting the array of ugens is basically impossible as far as I know. Strangely enough, I think it would be good if the functionality I learned to be impossible was possible in SC. I do not know why my thoughts tend in this direction.