It is still the responsibility of the RTcmix instrument designer to properly handle differing numbers of input channels (i.e. mono vs. stereo) in the Instrument::run() method. Ortgetin will configure it's input buffers and returned sample array based upon the values of the RTBUFSAMPS parameter. Ortgetin will automatically read a new input buffer whenever the current buffer of input samples is exhausted. Note that Ortgetin assumes that the input has been properly set using the rtsetinput function.
See the
instrument design
tutorial for more information on how Ortgetin is used.
#include <Ougens.h> Ortgetin *theIn; // this instrument will generate noise int MYINSTRUMENT::init(float p[], int n_args) { ... rtsetinput(inputskip, this); theIn = new Ortgetin(this); ... } int MYINSTRUMENT::run() { float out[2]; float in[2]; ... for (i = 0; i < framesToRun(); i++) { theIn->next(in); out[0] = in[0]; out[1] = in[1]; rtaddout(out); } ... }