| there are a lot of new array functions in
https://github.com/csudo/csudo/tree/master/arrays
the UDOs can be importet by including
https://github.com/csudo/csudo/blob/master/arrays/arrays.udo to any
csound file. i attach an example collection.
this is a list of all the UDOs and what they do:
ArrAddEl : iOutArr[] ArrAddEl iInArr[], iEl [,iPos]
add an element to an array
ArrAvrg : iAvrg ArrAvrg iArr[] [,iStart [,iEnd]]
calculate the average of a numeric array
ArrCat : iOutArr[] ArrCat iArr1[], iArr2[]
concatenate two arrays
ArrElCnt : iFound ArrElCnt iNeedle, iInArr[]
count the instances of an element in an array
ArrElIn : iRes ArrElIn iEl, iArr[]
report wheter an element is in an array or not
ArrPermRnd : iOutArr[] ArrPermRnd iInArr[] [, iN]
randomly permute an array (SC: scramble)
ArrPermRnd2: iOutArr[] ArrPermRnd2 iInArr[] [, iStart [, iEnd]]
randomly permute a slice of an array
ArrPermRndIndx: iOutArr[] ArrPermRndIndx iInArr[] [, iN]
randomly permute the indices of an array
ArrPldrm : iOutArr[] ArrPldrm iInArr[] [,iOpt]
creates a palindrome (SC: mirror)
ArrRmDup : iOutArr[] ArrRmDup iInArr[]
remove duplicate elements of an array
ArrRmEl : iOutArr[] ArrRmEl iInArr[], iEl
remove a specified element of an array
ArrRmIndx : iOutArr[] ArrRmIndx iInArr[], iIndx
remove a specified index of an array
ArrRndEl : iEl ArrRndEl iInArr[] [, iStart [, iEnd]]
return a random element of an array
ArrRtt : iOutArr[] ArrRtt iInArr[] [,iRot]
rotate an array
ArrRvrs : iOutArr[] ArrRvrs iInArr[]
reverse of an array
ArrSrt : kOutArr[] ArrSrt kInArr[] [,iOutN [,kOutType ,[kStart
[,kEnd [,kHop]]]]]
special sort of an array
together with the opcodes lenarray, minarray, maxarry, sumarray,
sorta(d), slicearray, scalearray, maparray, (de)interleave,
get(set)row(col), and printarray (to view the content), we have now a
nice collection to work with arrays, i think.
the UDO collection can perhaps also show that it is really easy to write
own functions, depending on the own needs.
thanks for corrections and suggestions, and if you have own UDOs which
you want to see here (as ArrElCnt by kevin welsh), just write me an email -
joachim
Csound mailing list
Csound@listserv.heanet.ie
https://listserv.heanet.ie/cgi-bin/wa?A0=CSOUND
Send bugs reports to
https://github.com/csound/csound/issues
Discussions of bugs and features can be posted here
|