csound-nstrexists provides a simple way to check whether an instrument number exists in the orchestra, at i-rate or k-rate. An example csd is provided in the examples/ directory demonstrating i and k-rate operation.
This depends on changes in commit cca2bd90bffc5c36499c74734e37ec256dc60924 on 2019-09-12 so it will not work with builds older than that.
The opcode has only been tested on Linux as of writing.
- Csound development libraries
- Cmake
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 libnstrexists module can be used with the --opcode-lib flag in Csound. eg:
cd csound-nstrexists
mkdir build && cd build
cmake ..
make && sudo make install
iexists nstrexists instrnum
kexists nstrexists knstrnum
Check if an instrument exists given the instrument number.
- iexists | kexists : 1 if instrument is found, 0 if not
- instrnum | knstrnum : the instrument number to check