Investigate a framework for writing Csound instruments in C++, either from Faust .dsp files, or using some C++ DSP library such as Gamma or AuLib.
It would have been nice to add to Csound the ability to define "plugin instrs" but since I no longer wish to get involved in core Csound development, the closest I can come is a generic interface to a family of opcodes.
It is not quite possible to have the opcode infer the entire signature, both input parameters and output parameters, from the instr context. It is necessary explicitly declare the output parameters; this is most flexibly done as an a-rate array variable. As for the input parameters, the pfields are available in an OpcodeBase instance from the opds.insdshead pointer.
There can then be an array of J variables (as with the STKAdapter), and also the opcode can try to find named global variables, and if they are not found, define and export them.
Investigate a framework for writing Csound instruments in C++, either from Faust .dsp files, or using some C++ DSP library such as Gamma or AuLib.
It would have been nice to add to Csound the ability to define "plugin instrs" but since I no longer wish to get involved in core Csound development, the closest I can come is a generic interface to a family of opcodes.
It is not quite possible to have the opcode infer the entire signature, both input parameters and output parameters, from the instr context. It is necessary explicitly declare the output parameters; this is most flexibly done as an a-rate array variable. As for the input parameters, the pfields are available in an OpcodeBase instance from the opds.insdshead pointer.
There can then be an array of J variables (as with the STKAdapter), and also the opcode can try to find named global variables, and if they are not found, define and export them.