sorta
Takes a numeric array (k or i-rate) and returns it sorted in ascending order.
Syntax
k/i[] sorta k/i[] (k- or i-arrays )
Examples
Here is an example of the sorta opcode. It uses the file sorta.csd.
Example of the sorta opcode. |
---|
| <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>
|
See Also
Array opcodes
Credits
Author: Victor Lazzarini
New in version 6.09