diff options
Diffstat (limited to 'README.md')
-rw-r--r-- | README.md | 101 |
1 files changed, 29 insertions, 72 deletions
@@ -1,17 +1,16 @@ -# csound-xtract : Csound feature extraction using libXtract +# csound-memread : Memory audification/sonification for Csound on Linux ## Overview -csound-xtract is a set of plugin opcodes which use libXtract to perform feature extraction and associated tasks from within Csound. - -Development is still ongoing and subject to various research matters, thus is provided in an experimental/alpha state and may contain bugs. Parts of the code are due overhauls and refactoring, but the intention is for the opcodes and general operation to remain the same as presented here. - +csound-memread provides a way to read data associated with a process ID as audio. +Only Linux is supported or an OS that supports userspace reading of /proc/.../mem ## Requirements -* Cmake >= 3.8 +* Linux +* Cmake >= 2.8.12 * Csound with development headers >= 6.14.0 -* [LibXtract](https://github.com/jamiebullock/LibXtract) +* Optional: X11 with development libraries -Tested on Linux and Windows 7 with MSYS as of March 2021. +Tested on Linux as of August 2021. ## Installation @@ -22,7 +21,7 @@ eg: cmake .. make && sudo make install -Cmake should find Csound and libXtract using the modules in the cmake/Modules directory and installation should be as simple as above. +Cmake should find Csound and X11 using the modules in the cmake/Modules directory and installation should be as simple as above. ## Examples Some examples are provided in the examples directory. @@ -30,79 +29,37 @@ Some examples are provided in the examples directory. ## Opcode reference -### iprofile xtprofile [ibuffersize=4096, iblocksize=512, imfccs=1, icentroid=1, izerocrossings=1, irms=1, iflatness=1, iirregularity=1, ipower=1, isharpness=1, ismoothness=1] -Declare a feature extraction profile for use in extraction opcodes. The exact techniques for extraction of individual features can be found by examining the libXtract documentation and source code. - -* iprofile : the profile handle - -* ibuffersize : buffer size used in extraction -* iblocksize : block size for extraction -* imfccs : use MFCCs -* icentroid : use spectral centroid -* izerocrossings : use zero crossings -* irms : use RMS -* iflatness : use spectral flatness -* iirregularity : use spectral irregularity -* ipower : use spectral power -* isharpness : use spectral sharpnesss - - -### icorpus xtcorpus iprofile, ifn -Analyse sound contained in a f-table and store in a handle, for later use in comparison/matching opcodes. Done during init time. - -* icorpus : the corpus handle - -* iprofile : profile handle as created by xtprofile -* ifn : f-table containing the sound to be analysed, typically GEN1 - - -### ixtract, kdone xtractor iprofile, ain -Analyse a live sound. - -* ixtract : the extraction handle - -* iprofile : profile handle as created by xtprofile -* ain : sound to analyse - - -### kdistance xtdistance ixtract1, ixtract2, ktrigger, [idistancefunc=0] -Compare two extraction streams using a basic distance function between each frame of the analyses. The profiles used for the streams must be the same. - -* kdistance : the calculated distance, 0 should represent no difference between the analyses. - -* ixtract1 : analysis stream as created by xtractor -* ixtract2 : analysis stream as created by xtractor -* ktrigger : comparison is conducted when 1 -* idistancefunc : 0 for Euclidean distance, 1 for Manhattan distance - - -### kanalysis[] xtdump ixtract -Obtain the analysis data from an xtractor handle. The array length will depend on the number of features specified in the profile used (MFCC uses 13 indexes, all others use 1). The indexes are presented in the same order as declared in xtprofile. For example, a profile using MFCC and centroid would mean indexes 0 to 12 would be MFCCs, and 13 would be centroid. Similarly a profile using only centroid and flatness would imply index 0 would be centroid, and 1 would be flatness. +### ipids[] memps +Obtain a list of process IDs owned by the executing user. -* kanalysis[] : the analysed features +* ipids[] : array of process IDs -* ixtract : analysis stream as created by xtractor +### Sname mempsname ipid +Get the process command line or name for a given process ID if available. -### kdone, kanalysis[] xtaccdump ixtract, ktrigger -Obtain the analysis data from an xtractor handle as with xtdump, but accumulate the analyses and output the mean when ktrigger is 1. +* ipid : the process ID -* kdone : outputs 1 when new data is provided, 0 at all other times -* kanalysis[] : the analysed features as with xtdump. +* Sname : the process command line -* ixtract : analysis stream as created by xtractor -* ktrigger : triggers the output of data when 1 +### ifn mem2tab ipid [, iskipzero=0] +Read the memory associated with a process ID into a new function table which can be +used by loscil and other such opcodes. -### kposition xtcorpusmatch icorpus, ixtract, ktrigger, [idistancefunc=0] -Obtain the nearest match in a corpus created with xtcorpus by comparing a live input stream created by xtractor. +* ifn : the function table number created -* kposition : position of nearest corpus region, in sample points +* ipid : the process ID +* iskipzero : if non-zero, skip empty memory locations, without this the output may contain a lot of silence depending on the process -* icorpus : corpus handle as created by xtcorpus -* ixtract : analysis stream as created by xtractor -* ktrigger : perform the comparison when 1 -* idistancefunc : 0 for Euclidean distance, 1 for Manhattan distance +### aout memson ipid, koffset, kbuffermultiplier [, ibuffersize=441000, iskipzero=0] +Buffered memory reading and direct audio output. The buffer is only refilled when koffset changes. +* aout : the sonified memory data +* ipid : the process ID +* koffset : position to read memory from, normalised to between 0 and 1 +* kbuffermultiplier : buffer read size multiplier between 0 and 1 +* ibuffersize : the size in samples of the buffer to read memory data into +* iskipzero : if non-zero, skip empty memory locations, without this the output may contain a lot of silence depending on the process
\ No newline at end of file |