csound-datacore provides a way to read raw data from disk, memory and screen.
For the memory and X11 window reading opcodes, only Linux is supported or an OS that supports userspace reading of /proc/.../mem
- Linux
- Cmake >= 2.8.12
- Csound with development headers >= 6.14.0
- Optional: X11 with development libraries
Tested on Linux as of August 2021, Windows as of March 2024.
Create a build directory at the top of the source tree, execute cmake .., make and optionally make install as root. If the latter is not used/possible then the resulting libcsxtract library can be used with the --opcode-lib flag in Csound.
eg:
mkdir build && cd build
cmake ..
make && sudo make install
Cmake should find Csound and X11 using the modules in the cmake/Modules directory and installation should be as simple as above.
Some examples are provided in the examples directory.
Obtain a list of process IDs readable by the executing user.
- ipids[] : array of process IDs
Get the process command line or name for a given process ID if available.
Get the memory usage of a process, interpreted as a number of audio samples.
Read the memory associated with a process ID into a new function table which can be
used by loscil and other such opcodes.
Buffered memory reading and direct audio output. The buffer is only refilled when koffset changes.
Read a file from the filesystem to a new f-table, interpreting raw character data as floats according to the orchestra samplerate and bit depth of the build.
Read a file from the filesystem, interpreting raw character data as floats according to the orchestra samplerate and bit depth of the build.
-
aL, aR : left and right channels. If only one output is specified then the file is read as mono data, otherwise stereo.
-
Sfile : path of the file to read
- iloop : whether to loop the reading of the file when the end is reached; 1 = loop, 0 = no loop
Read the contents of a X11 window and interpret pixel data as floats, outputting audio correpsonding to the orchestra samplerate and bit depth.
Currently not fully implemented and iwindowid will default to the DefaultRootWindow response from X11.