sorta — Sorts an array in ascending order.
Takes a numeric array (k or i-rate) and returns it sorted in ascending order.
k/i[]sorta k/i[] (k- or i-arrays )
Here is an example of the sorta opcode. Play sorta.csd
Example 987. Example of the sorta opcode.
See the sections Real-time Audio and Command Line Flags for more information on using command line flags.
<CsoundSynthesizer> <CsOptions> -n </CsOptions> <CsInstruments> instr 1 kArr[] fillarray 1,3,2,7,4 kSorted[] sorta kArr kn = 0 while kn < lenarray(kSorted) do printk2 kSorted[kn] kn += 1 od turnoff endin </CsInstruments> <CsScore> i1 0 1 </CsScore> </CsoundSynthesizer>
sortd
Author: Victor Lazzarini
New in version 6.09